Handy Git Commands

2013-02-16

Find commit associated with tag:
git rev-list $TAG | head -n 1

Show all changed files since a commit:
git diff –name-status [SHA1 [SHA2]]

Find latest commit for a file:
git rev-list -n 1 HEAD —

Restore deleted file:
git checkout <deleting_commit>^ — <file_path>

Written on February 16, 2013