git reset --soft, any changes are left as staged (or "ready to commit")git reset --mixed, any changes are left as unstagedgit reset --hard, any changes are discarded
git reset --soft HEAD~3This will move HEAD three commit back, and keeps all changes from the where you where (two commits later) as staged.
If you now do a new commit, you will effectivly have squashed your last three commits.
git reset --hardThis will discard all pending changes (both staged and unstaged), but not move the HEAD.
Shortcuts for path-specs
HEADis the current commitHEAD^is the same asHEAD~1, meaning one commit back from current commitHEAD^^is the same asHEAD~2, meaning two commits back from current commit