Undo last commit

If you want to undo the last commit but don’t want to lose the local modifications:

git reset --soft HEAD~1