Revert a branch merge to default in Mercurial

I want to revert a merge I have done with mercurial and I don't see it clear on the website I have found in Google.

My latest Mercurial changeset is 0d9973c7ade3 - Merge 'feature/20' with 'default'. that I have pushed and I want to go back.

The changeset I want to go back is 8dc9b342ea75 which is a changeset in default where I want to revert to.

How I can do it?


Since you have pushed your merge, the right solution greatly depends on how many people use your "master" repository and what control you have on them.

If you are using this repository alone, you can use the MQ extension to strip change the history and be done with it. You need a total access to the repository for this.

If other people are using the repository, it will be more complicated. If you want a "clean" history, you will need the collaboration of everyone to do it. If this is not possible, you can revert the changes, but the history will have a trace of it.

Clean history solution

You will have to activate the MQ extension on the "master" repository. Then you can use the strip command to remove all unwanted commits :

 hg strip unwantedrevision

You must then clone the repository again to remove every occurrence of the deleted changesets. Or you can also strip the changesets on each repository that have them.

If one repository still have the changes in its history after the operation, it will be pushed again the next time. This is why you need the collaboration of every one that has a copy.

Other solution

If you can't control all the clones, you can use the backout command. I can't help you much with it, I've never have to use it. However the linked documentation seems clear enough to me.

Good luck with your problem :)

Need Your Help

C# - SQLClient - Simplest INSERT

c# sql sql-server tsql

I'm basically trying to figure out the simplest way to perform your basic insert operation in C#.NET using the SqlClient namespace.

Getting date parts from a simple treetop parser: wrong argument type Class (expected Module)

ruby-on-rails ruby parsing treetop

For the following treetop grammer, when parsing '3/14/01' (via t = Parser.parse('3/14/01') in irb), I get a "TypeError: wrong argument type Class (expected Module)".

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.