block by joyrexus 7830840

Undo a pushed commit

How to undo a commit that’s already been pushed to a remote?

First, reset your local branch to the parent of the current commit:

git reset HEAD^ --hard

Then, push the reverted HEAD point to the remote:

git push --force origin

For more details see this post and this thread on StackExchange.