title: Strange output of "git diff", "git diff HEAD" and "git diff --staged"?
body: <p>There are 3 main <code>git diff</code> versions:    </p>
  
  <blockquote>
    <ul>
    <li><strong><code>git diff</code></strong> - difference between <strong>WORKING DIRECTORY</strong> &amp; <strong>STAGE</strong> </li>
    <li><strong><code>git diff --staged</code></strong> - difference between <strong>HEAD</strong> &amp; <strong>STAGE</strong> </li>
    <li><strong><code>git diff HEAD</code></strong> - difference between <strong>HEAD</strong> &amp; <strong>WORKING DIRECTORY</strong>   </li>
    </ul>
  </blockquote>
  
  <p>Above are the definitions I found almost at every place from various people over the net </p>
  
  <p>I performed certain commits on 3 files in the following order:    </p>
  
  <blockquote>
  <pre><code>ce6f5bb (HEAD -&gt; master) 6th commit, file1
  c1c67da 5th commit, file3    
  ea51776 4th commit, file1 file2    
  001675b 3rd commit, file1 file2    
  ec04f53 2nd commit, file2    
  21cb6c1 1st commit, file1  
  </code></pre>
    
    <p><strong>a. file2</strong> <em>modified in working direcory</em><br>
    <strong>b. Nothing STAGED for commit</strong><br>
    <strong>c. file1</strong> &amp; <strong>file3</strong> <em>not modified</em></p>
  </blockquote>
  
  <hr>
  
  <p>My Queries are:    </p>
  
  <h2><strong>1. git diff</strong></h2>
  
  <pre><code>    git diff
      diff --git a/file2.txt b/file2.txt
      index 21106bf..c755a1e 100644
      --- a/file2.txt
      +++ b/file2.txt
      @@ -1,3 +1,4 @@
       123
       345
       678
      +90.    
  </code></pre>
  
  <p><strong><em>Even though STAGING AREA WAS EMPTY, why diff was shown?</em></strong>    </p>
  
  <hr>
  
  <h2><strong>2. git diff HEAD</strong></h2>
  
  <pre><code>    git diff
      diff --git a/file2.txt b/file2.txt
      index 21106bf..c755a1e 100644
      --- a/file2.txt
      +++ b/file2.txt
      @@ -1,3 +1,4 @@
       123
       345
       678
      +90.    
  </code></pre>
  
  <p><strong><em>if LAST COMMIT (HEAD) was related to file1, then why diff of file2 is shown?</em></strong><br>
  <strong>HEAD doesn't contain anything related to file2 at all</strong>    </p>
  
  <hr>
  
  <hr>
  
  <h2><strong>NOW AFTER STAGING file2</strong> :</h2>
  
  <h2><strong>3. git diff</strong></h2>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <p>It does not show anything!<br>
  <em>(I assume it will only show diff if a file is Staged as well as some <strong>changes apart from</strong> staged version are made in Working Directory too)</em><br>
  Well if that is the case, then why diff was shown in <strong>1.</strong></p>
  
  <hr>
  
  <h2><strong>4. git diff --staged</strong></h2>
  
  <pre><code>    git diff
      diff --git a/file2.txt b/file2.txt
      index 21106bf..c755a1e 100644
      --- a/file2.txt
      +++ b/file2.txt
      @@ -1,3 +1,4 @@
       123
       345
       678
      +90.    
  </code></pre>
  
  <p><strong><em>again if HEAD is pointing to file1, then why diff of file2 is shown?</em></strong>    </p>
  
  <hr>
  
  <hr>
  
  <p>I CREATED THIS IMAGE BELOW <strong>(Note: ANOTHER SCENARIO. Not same as above)</strong>:    </p>
  
  <p>for <code>git diff HEAD</code>, My guess is that <strong>for every TRACKED FILE</strong>, HEAD will keep traveling backward until it finds the LATEST VERSION OF THAT FILE which was committed, to compare against the one in Working Directory</p>
  
  <p>If we consider a new scenario as below, then for <code>git diff HEAD</code>, is it like below what I have assumed?</p>
  
  <p><a href="https://i.stack.imgur.com/Ryqy3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ryqy3.png" alt="enter image description here"></a></p>