title: Why does git rebase delete a file added in the most recent commit if it was deleted by the rebase branch?
body: <p>I'm trying to figure out why git rebase causes a newly created file to be deleted if the branch I'm rebasing off of deleted it. For example:</p>
  
  <pre><code>A1 - A2 - A3
   \
    B1
  
  A2 = add a new file test.txt
  A3 = delete test.txt
  B1 = add the exact same file as A2
  </code></pre>
  
  <p>If B1 is checked out and I execute <code>git rebase A3</code>, test.txt is still deleted. I'd expect the result to be:</p>
  
  <pre><code>A1 - A2 - A3 - B1
  </code></pre>
  
  <p>Which would mean that test.txt still exists. Why is test.txt deleted after the rebase?</p>