 <p>If the file has been staged (it looks like yours was), a snapshot will exist is Git's database. We can get it back!</p> <p>Git stores snapshots internally in the <code>.git/objects/</code> direction in your repository. Each object is stored in a file named for its hash, split into directories by the first 2 characters. Snapshots will exist here until they are either packed into files in <code>.git/objects/pack/</code> (which won't happen to a snapshot that was never part of a commit) or garbage collected (which will eventually happen to your missing file). The hard part will be figuring out which object it is.</p> <p>To find the object, run</p> <pre><code>ls -lRt .git/object </code></pre> <p>to get a list of all objects sorted by last modified time. Here's what my hypothetical repository looks like:</p> <pre><code>$ ls -lRt .git/object .git/objects/22: total 4 -r--r--r-- 1 peter peter 17 Sep 1 11:18 3b7836fb19fdf64ba2d3cd6173c6a283141f78 .git/objects/f7: total 4 -r--r--r-- 1 peter peter 17 Sep 1 11:09 0f10e4db19068f79bc43844b49f3eece45c4e8 .git/objects/54: total 4 -r--r--r-- 1 peter peter 51 Sep 1 11:08 3b9bebdc6bd5c4b22136034a95dd097a57d3dd .git/objects/e8: total 4 -r--r--r-- 1 peter peter 134 Sep 1 11:08 e8417380c89509ec1e5b67c15469547a4489c2 .git/objects/e6: total 4 -r--r--r-- 1 peter peter 15 Sep 1 11:08 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 </code></pre> <p>Run</p> <pre><code>git cat-file -p &lt;hash&gt; </code></pre> <p>on candidate objects until you find the one you're missing. Remember to add the 2 characters from the directory name to the hash. In my case, if I'm interested in the file from 11:09</p> <pre><code>git cat-file -p f70f10 </code></pre> <p>Happy hunting.</p>