Skip to content

Instantly share code, notes, and snippets.

@bonyiii
Created May 26, 2011 08:26
Show Gist options
  • Select an option

  • Save bonyiii/992770 to your computer and use it in GitHub Desktop.

Select an option

Save bonyiii/992770 to your computer and use it in GitHub Desktop.
how to know when a file was deleted from git
# source: http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo
Use git log --diff-filter=D --summary to get all the commits which have deleted files and the files deleted;
Use git revert $commit to revert that particular commit.
Using --summary instead of --name-only displays the actions taken.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment