title: What does git checkout do?
body: <p>I thought that the <code>git checkout</code> command updated files in the working tree only. In fact, the man page reads:</p>
  <blockquote>
  <p>git-checkout - Switch branches or restore working tree files</p>
  </blockquote>
  <p>However, I've just run this command:</p>
  <pre><code>git checkout 11cb5b6 -- hello.txt
  </code></pre>
  <p>and, in addition to updating my working tree copy, this command also updated my index. Before the command, <code>git status</code> was giving me a clean result:</p>
  <pre><code>nothing to commit, working tree clean
  </code></pre>
  <p>but immediately after the <code>checkout</code>, it reads:</p>
  <pre><code>Changes to be committed:
    (use &quot;git restore --staged &lt;file&gt;...&quot; to unstage)
      modified:   hello.txt
  </code></pre>
  <p>i.e. the working tree file has been updated AND staged. What am I missing?</p>