git remove a commit from remote branch code example
Example 1: how to undo a commit from remote
git reset --hard HEAD~3
git push -f
Example 2: delete a pushed commit
$git log --pretty=oneline --abbrev-commit
git reset --hard HEAD~3
git push -f
$git log --pretty=oneline --abbrev-commit