I did a commit and reverted with
git revert HEAD^
just git log
➜ git:(master) git log
commit 45a0b1371e4705c4f875141232d7
Here is a simple working solution that delete the last commit from remote:
$ git clone git@host:PROJ/myrepo.git $ cd myrepo $ git log --pretty=oneline 234987fed789de97232ababababcef3234958723 bad_commit e4a2ec4a80ef63e1e2e694051d9eb3951b14c407 v4.3 2f116449144dbe46e7260d5dac2304803751b5c2 v4.2
$ git checkout e4a2ec4a80ef63e1e2e694051d9eb3951b14c407 $ git checkout -b temp_branch
git push origin --delete dev_branch git push origin temp_branch:dev_branch