We are working on a project with a two-branch system (default/stable) and use a remote repository. A coworker has implemented a new feature on the wrong branch stable, and pushed the changes to the remote repository. The changes should have been made to the default branch.
Ideally, I would like to end up with the changes moved to the default branch, with no indication of the commit on the stable branch. Are we kinda screwed since it was already pushed?
I cloned the repo and tried to rollback the local copy, but that didn't have the effect I thought it would. I tried to use the rebase extension, but I don't see a way to move the commit to another branch. I tried the backout option, but that left history that I don't want.
I suppose I could do this manually by:
Is this the only way to do this?
If the change is public, the only way to remove all trace is to strip the change for the public repo and all clones. That could be impractical.
To undo the changes, you'll need to graft the changeset back to default, and backout the changeset from stable:
Example, current state:
Commands:
hg update default
hg graft 3
hg update stable
hg backout 3
Result: