To undo the last commit from a remote git repository, you can use the git reset command
.
First you can use the following command to undo the last commit locally.
git reset HEAD^
Then you are able to use the following command to force push the local commit which was reverted to the remote git repository.
git push origin +HEAD
Top comments (0)