title: How to view file diff in git before commit
body: <p>This often happens to me: </p>
  
  <p>I'm working on a couple related changes at the same time over the course of a day or two, and when it's time to commit, I end up forgetting what changed in a specific file. (This is just a personal git repo, so I'm ok with having more than one update in a commit.) </p>
  
  <p>Is there any way to preview the changes between my local file, which is about to be checked in, and the last commit for that file? </p>
  
  <p>Something like:</p>
  
  <pre><code>git diff --changed /myfile.txt
  </code></pre>
  
  <p>And it would print out something like:</p>
  
  <pre><code>line 23
    (last commit): var = 2+2
    (current):     var = myfunction() + 2
  
  line 149
    (last commit): return var
    (current):     return var / 7
  </code></pre>
  
  <p>This way, I could quickly see what I had done in that file since it was last checked in.</p>