how to exclude last commit and push a new one code example Example: revert last push to server git reset --hard HEAD@{1} git push -f