Delete the commit and its changes completely:
git reset --hard HEAD~1To undo the last commit but keep your changes staged:
git reset --soft HEAD~1Keep the changes but unstage them:
git reset HEAD~1If commit was pushed to remote and you want to remove it from there as well, then
git push --forceAnother option is to add a new commit reverting that commit, useful when you want to keep that commit in your git history
git revert HEAD
git push