If you broke the tree but didn't commit the code, you can use git reset
, and if you just want to restore one file, you can use git checkout
.
If you broke the tree and committed the code, you can use git revert HEAD
.
http://book.git-scm.com/4_undoing_in_git_-_reset,_checkout_and_revert.html