title: What's the --index option for git stash pop for?
body: <p>As far as I'm aware, <code>git stash</code> saves a <s>diff between the working tree and <code>HEAD</code>, it doesn't save the index</s>, the state of the working tree, as well as the index. You can see this by running <code>git log --graph stash@{0}</code> after creating a stash.</p>
  
  <p><code>git stash pop</code> has an option <code>--index</code>, with this documentation:</p>
  
  <blockquote>
    <p>If the --index option is used, then tries to reinstate not only the working tree’s changes, but also the index’s ones. However, this can fail, when you have conflicts (which are stored in the index, where you therefore can no longer apply the changes as they were originally).</p>
  </blockquote>
  
  <p>I don't understand this documentation. The second sentence in the quoted documentation is confusing to me.</p>
  
  <p>Why do merge conflicts unexpectedly happen? For example:</p>
  
  <pre><code>$ git init test
  $ cd test
  $ echo initial &gt; file
  $ git add file
  $ git commit -m initial
  $ echo a &gt;&gt; file
  $ git add file
  $ echo b &gt;&gt; file
  $ git stash save --keep-index
  $ git stash pop --index
  Auto-merging file
  CONFLICT (content): Merge conflict in file
  </code></pre>
  
  <p>I don't understand why a merge conflict happens in the last step. What I want to happen is for <code>git stash pop --index</code> to recognise that the index is already in the correct state, and to change the working tree files to match the stashed files.</p>