title: How can I unstage my files again after making a local commit?
body: <p>I have executed the following command</p>
  
  <pre><code>git add &lt;foo.java&gt;
  git commit -m "add the foo.java file"
  </code></pre>
  
  <p>How can I delete my local commit now and unstage foo.java?</p>
  
  <p>If I type <code>git reset --hard</code>, I found that it reverts my modified <code>foo.java</code> to the original one.</p>