Be careful using this, it’s might cause data lose:
git reset HEAD^ # Remove the last commit locally
git push origin +HEAD # force-push the new HEAD commit
Code language: Bash (bash)
If you want to still have it in your local repository and only remove it from the remote, then you can use:
git push origin +HEAD^:<name of your branch, most likely 'master'>
Code language: Bash (bash)
Leave a Reply