Retrieve single file from old commit on GIT
To retrieve a single file from an old commit to your working copy, simply use:
$ git checkout [revision_hash] [file_name]
You can use the HEAD pointer as the [revision_hash] if you want to:
HEAD - Points to the Last Commit on the current repository;
HEAD^ - Last Commit - 1;
HEAD^^ - Last Commit - 2;
HEAD~10 - 10 commits behind of HEAD;
Written by Willy Barro
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#