Advanced Git usage patterns
This is work in progress
Undo latest commit
If the idea is to add, remove or edit a file to your latest commit:
git reset --soft HEAD~
If this was just a mistake, you just want to forget about everything:
git reset --hard HEAD~
Compress your git history
git gc --aggressive --prune=now