Created
December 30, 2010 20:21
-
-
Save christoomey/760246 to your computer and use it in GitHub Desktop.
Have git output the contents of a deleted file from the commit before it was deleted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_show_deleted_file { | |
# Rev-list command gets commit that deleted the file, ^ gets prior commit | |
git show $(git rev-list -n 1 HEAD -- $1)^:$1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment