Say I\'m in a Git repository. I delete a file and commit that change. I continue working and make some more commits. Then, I find I need to restore that file.
I know
If you know the filename, this is an easy way with basic commands:
List all the commits for that file.
git log -- path/to/file
The last commit (topmost) is the one that deleted the file. So you need to restore the second to last commit.
git checkout {second to last commit} -- path/to/file