title: git rebase: "error: cannot stat 'file': Permission denied"
body: <p>I'm using git, and made a small commit followed by a large one.  I decided to use <code>git rebase</code> to squash the two commits together before pushing them.  (I've never done this before.)</p>
  <p>So I did:</p>
  <p><code>git rebase -i HEAD~2</code></p>
  <p>This gave me my editor, where I chose to pick the earlier commit and squash the later one.  When I saved, git said:</p>
  <blockquote>
  <p>error: cannot stat '<em>filename</em>': Permission denied</p>
  <p>Could not apply <em>sha1 for later commit</em>... <em>initial line of text for that commit</em></p>
  </blockquote>
  <p>Now:</p>
  <ul>
  <li>Neither commit appears when I do <code>git log</code>.</li>
  <li><code>git status</code> tells me I'm &quot;Not currently on any branch.&quot;</li>
  <li>One file is listed as modified and in the index, and two files are listed as untracked.  My first commit had just one file (I think), and my second commit had a good dozen.</li>
  </ul>
  <p>What happened!?  How do I fix it?</p>