Skip to content

Instantly share code, notes, and snippets.

View yanshiyason's full-sized avatar

Shiyason yanshiyason

View GitHub Profile
@yanshiyason
yanshiyason / git-find-me-the-fucking-deleted-file.sh
Created December 20, 2021 00:43 — forked from joakin/git-find-me-the-fucking-deleted-file.sh
finding a deleted file in a git repository
# 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