Sunday, 30 October 2011

Restoring a single file from git

Okay, so you've done a few commits, pushes and pulls - but you've made a mess of a file? How do you get it back?

Simplest way is to first get the commit number from the log

git log

Then use git checkout with the commit number

git checkout [commit-ref] [filename]
Simples :)

No comments:

Post a Comment