title: How to compare the working copy, staging copy and committed copy of a file using git
body: <p>Assume for a moment I have a file in a repository called LICENSE.txt. The contents looks as follows:</p>
  
  <pre><code>Copyright 2014 MyCompany. All Rights Reserved.
  </code></pre>
  
  <p>Since its 2015 I changed the year so its 2015:</p>
  
  <pre><code>Copyright 2015 MyCompany. All Rights Reserved.
  </code></pre>
  
  <p>And then staged the file</p>
  
  <pre><code>git add LICENSE.txt
  </code></pre>
  
  <p>Being a tad distracted, I made another change to LICENSE.txt to reflect that another organization shares in the copyright.</p>
  
  <pre><code>Copyright 2015 MyCompany and Affiliates. All Rights Reserved.
  Copyright 2015 Other Company. All Rights Reserved.
  </code></pre>
  
  <p>I'm able to see the difference between my working copy and staged copy by running</p>
  
  <pre><code>git diff 
  </code></pre>
  
  <p>And I'm able to see the difference between the staged copy and committed copy by running</p>
  
  <pre><code>git diff --cached
  </code></pre>
  
  <p>How do I compare the committed copy (the one without the year change) with working copy (the one with the additional copyright)?</p>
  
  <p>This is purely an example. There are cases much more complex where I had the need to compare what I have staged with changes I subsequently made to the file. Comparing the contents of the working copy and the staged copy will determine whether I should replaced the staged copy or not.</p>
  
  <p>I'm running git 1.9.5 on Windows Server 2012 R2. </p>