git reset
git reset [--soft | --mixed | --hard] <commit>
Risk: Careful
What it does
Moves your branch back to an older commit.
When to use it
Only for commits you have not shared yet.
Example
$ git reset --soft HEAD~1Undo the last commit. Changes stay in the box.
$ git reset HEAD~1Changes go back to your folder.
$ git reset --hard HEAD~1Changes are wiped. Danger!
Learn it in: Reset lab · Official docs