title: Git: Show content of file as it will look like after committing
body: <p>After reading <a href="https://stackoverflow.com/questions/2412450/git-pre-commit-hook-changed-added-files">Git pre-commit hook : changed/added files</a>, the following question arose:</p>
  
  <p>Given I have a file with both staged and unstaged changes, how can I display a preview of the file's contents after staging?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>echo "foo" &gt;&gt; file
  git add file
  echo "bar" &gt;&gt; file
  </code></pre>
  
  <p>Wanted output:</p>
  
  <pre><code>[previous contents of file]
  foo
  </code></pre>