git remove last merge commit code example Example: git remove last merge commit git reset --hard HEAD^ git push --force origin master