title: Git reset loses track of moving files
body: <p>I've got a git repo that looks like this</p>
  <pre><code>          v master
  A &lt;- B &lt;- C &lt;- D
                 ^ foo
  </code></pre>
  <p>where <code>master</code> and <code>foo</code> are two branches.
  I want to merge <code>foo</code> into master, but I want to refactor commit <code>D</code> first.
  The differences between <code>C</code> and <code>D</code> are the following:</p>
  <ul>
  <li>A couple of files have minor changes.</li>
  <li>Several files were moved from their old location to a new one in a new directory.
  I'd like to split <code>D</code> up into two commits, one with the edits and one with the file moves.
  Normally I'd do this by checking out <code>D</code>, doing <code>git reset C</code>, and then committing stuff as I see fit.</li>
  </ul>
  <p>However, when I do <code>git reset C</code>, git seems to completely forget that some of the files were moved renamed. Instead, it thinks that I deleted some files and created some other ones.</p>
  <p>How do I help git understand what's going on, so that I can split the edits and file moves?</p>
  <p>Here's a complete shell session illustrating the issue:</p>
  <pre><code>~/src/junk$ git init
  Initialized empty Git repository in &lt;snip&gt;
  ~/src/junk$ touch a.txt b.txt c.txt
  ~/src/junk$ git add a.txt b.txt c.txt 
  ~/src/junk$ git commit -m &quot;Initial commit.&quot;
  [main (root-commit) c76830b] Initial commit.
   3 files changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 a.txt
   create mode 100644 b.txt
   create mode 100644 c.txt
  ~/src/junk$ mkdir Subdir
  ~/src/junk$ git mv b.txt c.txt Subdir/
  ~/src/junk$ echo &quot;This is text.&quot; &gt; a.txt
  ~/src/junk$ git add a.txt 
  ~/src/junk$ git commit -m &quot;Moved b.txt and c.txt, edited a.txt.&quot;
  [main 9efc354] Moved b.txt and c.txt, edited a.txt.
   3 files changed, 1 insertion(+)
   rename b.txt =&gt; Subdir/b.txt (100%)
   rename c.txt =&gt; Subdir/c.txt (100%)
  ~/src/junk$ git reset HEAD~1
  Unstaged changes after reset:
  M   a.txt
  D   b.txt
  D   c.txt
  ~/src/junk$ git status
  On branch main
  Changes not staged for commit:
    (use &quot;git add/rm &lt;file&gt;...&quot; to update what will be committed)
    (use &quot;git restore &lt;file&gt;...&quot; to discard changes in working directory)
      modified:   a.txt
      deleted:    b.txt
      deleted:    c.txt
  
  Untracked files:
    (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)
      Subdir/
  
  no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
  </code></pre>