Can we undo pushed changes in Mercurial?

2.5k Views Asked by At

I am using mercurial and have pushed some changes that I have to revert back. I didn't find any way to directly rollback that changes. I can remove my changes and commit it back but that would not be a right way to do that. Can anyone please suggest how I can do that?

2

There are 2 best solutions below

0
On BEST ANSWER

You need to login to the server and use the hg strip command. If you cannot login to the server, you are out of luck; you can hg backout then push again, but this will leave the bad commits on the server along with the commit that undoes them.

For more details: Mercurial: Remove changeset from remote branch

0
On

hg revert -r .^ file-to-revert followed by hg commit and jf s (if using jelly fish) that will remove the changeset from your diff.