how to delete last commit that wasn't pushed code example Example: git delete last commit after push git reset --hard HEAD~1 git push -f <remote> <branch>