cancel commit 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
Example 3: undo last commit pushed
git reset # commitId
# Exemple
git reset 5310517
Example 4: git how to undo a pushed commit
git revert <commit_hash>