title: How can you undo the last git add?
body: <p>Is it possible to unstage the last staged (not committed) change in <strong>git</strong>? Suppose there were a lot of files in the current branch, some staged, some not. At some point, some foolish programmer accidentally executed:</p>
  
  <pre><code>git add -- .
  </code></pre>
  
  <p>...instead of:</p>
  
  <pre><code>git checkout -- .
  </code></pre>
  
  <p>Can this programmer now unstage his last changes with some magical <strong>git</strong> command? Or should he have committed before experimenting in the first place?</p>