Skip to content

Instantly share code, notes, and snippets.

@emailrhoads
Last active March 25, 2020 14:59
Show Gist options
  • Save emailrhoads/d9d1629d98325d480d220e792d4b9457 to your computer and use it in GitHub Desktop.
Save emailrhoads/d9d1629d98325d480d220e792d4b9457 to your computer and use it in GitHub Desktop.
[Restore deleted file] #git

get all the commits which have deleted files and the files deleted; git log --diff-filter=D --summary

to restore the deleted file. git checkout $commit~1 path/to/file.ext

where $commit is the value of the commit you've found at step 1, e.g. e4cf499627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment