remove last commit not pushed code example
Example 1: cancel a commit not pushed
git reset --soft HEAD~
Example 2: revert last push to server
git reset --hard HEAD@{1}
git push -f
git reset --soft HEAD~
git reset --hard HEAD@{1}
git push -f