Skip to content

Instantly share code, notes, and snippets.

@jin
Created October 2, 2011 13:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jin/1257450 to your computer and use it in GitHub Desktop.
Save jin/1257450 to your computer and use it in GitHub Desktop.
Git: Restore a deleted file
#!/bin/sh
git log --diff-filter=D --summary
git checkout $commit~1 filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment