Git: How to amend

Published:

Keep forgetting how to do this...

# To amend previous commit
git commit --amend --no-edit

# To amend previous commit and change message
git commit --amend -m "Changed message"

# To push afterwards (don't do this on shared branches)
git push --force