You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rainer Hihn 8a95063c8c Update '' 3 months ago Update '' 3 months ago


Find the last commit of a now-deleted file thefile

If you do not know the exact path you may use

git log --all --full-history -- "**/thefile.*"

If you know the path the file was at, you can do this:

git log --all --full-history -- <path-to-file>

Restore it into your working copy with:

git checkout <SHA>^ -- <path-to-file>

Note the caret symbol (^), which gets the checkout prior to the one identified, because at the moment of commit the file is deleted, we need to look at the previous commit to get the deleted file's contents