Undo commits & changes
Revert a commit (Doesn't change history)
Revert every changes made in a commit with a new 'revert' commit
Revert changes made after last commit
Revert every changes made after last commit. 3 modes available :
- Soft : Keep changes, Unstage changes
- Mixed(default) : Keep changes, Unstage changes
- Hard : Delete changes
Warning
You permanently lose every changes made locally since last commit
Revert to specific commit
Use Case #1 : How to reset last terrible commit (Last good commit is 32e4fc4)) ?
Use Case #2 : How to rewrite history since commit 47e9cf6 ?
Info
Go in the past, make changes to fix bug and then commit to rewrite history.
Remove a specific commit
Use Case : You leaked information in a specific commit and you want to completely remove this commit ?
Amend
Combine few commits
Warning
Only do this locally on commits we haven't push to remote yet !