title: Does git checkout update the staging area?
body: <p>The staging area can be updated via <code>git reset</code>, is there any case <code>git checkout</code> (or with many extra parameters) would update the staging area from new HEAD?</p>
  
  <p><strong>UPDATE</strong>: It seems git's behavior depends on whether you check out a file or a branch/commit. </p>
  
  <ol>
  <li>If no file specified, it <strong>updates HEAD</strong> to point/switch to given branch/commit, and will warn and block the switch if there is any change in staged area and work tree. For example, <code>git checkout DevBranch</code>.</li>
  <li>If file is specified but no branch/commit, it copies the specified file from staged area to work tree and doesn't touch stage area (<strong>doesn't update HEAD</strong>). For example, <code>git checkout file.txt</code> or <code>git checkout -- file.txt</code>.</li>
  <li>If both branch/commit and file are specified, it updates the specified file in both stage area and work tree from given branch/commit (<strong>doesn't update HEAD</strong>). For example, <code>git checkout DevBranch -- file.txt</code>.</li>
  </ol>