Skip to content

Instantly share code, notes, and snippets.

@AJ-7885
Last active May 15, 2023 11:49
Show Gist options
  • Save AJ-7885/82bd0259cf54167672810e49639b29f4 to your computer and use it in GitHub Desktop.
Save AJ-7885/82bd0259cf54167672810e49639b29f4 to your computer and use it in GitHub Desktop.
gistpad-scratch

If you don't remember the exact path/name, search the log for deleted files

git log --diff-filter=D --summary | grep delete

Find the file you want to get from the ouput, and use the path

Find the commits that involved that path

git log --all -- some/path/to/deleted.file

Bring the file back to life to the current repo (sha commit of parent of commit that deleted)

git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file

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