title: How to remove a file from the staging area (= index = cache) in Git?
body: <p><strong>EDIT</strong> This question can be understood in two ways, and the optimal answer is different in the two cases.</p>
  <ul>
  <li><p>Question 1: I added a <strong>previously untracked file</strong> to the staging area. How can I remove this file from the staging area without removing it from the file system?</p>
  <p>Answer 1: Use the following command, as described in <a href="https://stackoverflow.com/a/2223340/17916">John Feminella's answer</a>:</p>
  <pre><code>git rm --cached &lt;file&gt;
  </code></pre>
  </li>
  <li><p>Question 2: I modified a <strong>file already tracked</strong>, and added my modifications to the staging area. How can I remove my modifications from the staging area? I.e., how can I unstage my modifications in the file?</p>
  <p>Answer 2: Use the following command, as described in <a href="https://stackoverflow.com/a/2223321/17916">David Underhill's answer</a>:</p>
  <pre><code>git reset &lt;file&gt;
  </code></pre>
  </li>
  </ul>