Git: Checkout revisions past

If you want to checkout a file as it was one revision ago on the master branch:

 git checkout master~1 thedir/thefile.txt

I used this to remove an update to a file when amending a commit.

(I hadn't pushed to master, hence the ability to amend without screwing things up.)

git git-checkout

Edit on github
comments powered by Disqus
Click me