August 12, 2008

Git - revert / undo local modifications

To undo local modification to file

git checkout -f /path/to/file

To revert a recent commit
git reset HEAD~

Good reference for Git material: Kernel Hackers’ Guide to git