I have merged an old copy replacing many files that have been replaced by the older version (my last check out..about a week ago). I am wanting to reset to the previous commit (reverse my damage of merging), is there any way to reverse this merge without losing all the changes since the old checkout? Any help will be appreciated, thanks in advance!
If you've already committed the merge, then the only way to really undo it is to check out / update to the commit before the merge was done, and proceed from there. You can discard the merge commit using 'strip' in Mercurial and by using 'Reset <branch> to this commit' in Git. Bear in mind that if you've pushed the merge though, you won't want to do that - you'll just have to leave it as an orphaned stream of development unless you're willing to potentially upset other people.
If, you've made commits after the merge that you want to keep, it becomes trickier. You probably want to cherry-pick the commits across to the new branch point in order to do that, but you should expect some potential conflicts.
Revert/Reversing a merge commit has it's advantages. Hence why it's there in Git itself (I'm not sure about hg here).
That directly references reversing the merge commit, which sourcetree does not handle correctly (with the -m flag).
If you have a branch that had a hypothetical 10,000 commits on it, you then merged (badly) into a branch that 20 other people then began working on immediately afterwards.
To cherry-pick each one of those commits is frustrating—and in this exaggerated example will probably take years if done manually—so the simple solution would be to reverse the merge commit, then attempt it again. With git, this is simply done: `git revert -m`.
However attempting this via SourceTree will fail due to it not applying this flag. Thus resulting in having to throw SourceTree aside and boot up a prompt simply to revert a single commit.
Could this be resolved?
Thasnk you for the quick response. I found this post later after I had already asked. This does answer a portion of the question. It does fall more into the issue mentioned by Steve. I will investigate with this "cherry picking". I am familiar with its purpose, but have never leveraged this tool. I appreciate the help and believe this will solve my issues. I appreciate the elaborating on the question response (I should have traced through the backlog to better define my question so it is unique).
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs