Since your commits are pushed remotely you need to remove them. I'll assume your branch is master
and it's pushed over origin
.
You first need to remove master
from origin
:
git push origin :master
(note the colon)
Then you need to get master
to the status you want, I'll assume the commit hash is ABCDE
:
git reset --hard ABCDE
Lastly, push master
again:
git push origin master
That's it! Note that if someone already downloaded your changes from origin
this will screw them pretty much leaving their local repos unstable.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…