title: How do you revert a file in Git only?
body: <p>I updated files and committed them, e.g. </p>
  
  <pre><code>git add *lots of files*
  git add b.txt
  git commit -m 'Update files'
  </code></pre>
  
  <p>Now I realize I actually want to make the changes to <code>b.txt</code> in a different commit. I want to remove the changes to <code>b.txt</code> from my commit, but I want to keep the changes in the filesystem. If <code>b.txt</code> were a new file, I could do this with</p>
  
  <pre><code>git rm --cached b.txt
  </code></pre>
  
  <p>But this doesn't work for reverting <code>b.txt</code> to its previous state in the staging area.</p>
  
  <p>Basically, I want to check out directly into the staging area without modifying my local files. Is there a way to accomplish this with a single command in Git?</p>
  
  <p>This question is not a duplicate of <a href="https://stackoverflow.com/questions/215718">Reset or revert a specific file to a specific revision using Git?</a> because that asker wants to change the working tree, but here I don't want to change the working tree.</p>