Git - Undoing What is Done

From EdWiki

Undoing What is Done

git checkout
  • Used to checkout a specific version/branch of the tree
git reset
  • Moves the tree back to a certain specified version
  • Use the --force to ignore working changes
git revert
  • Reverts a commit
  • Does not delete the commit object, just applies a patch
  • Reverts can themselves be reverted!
  • Git never deletes a commit object