I merged two branches that shouldn’t have been merged: A & B. I want to undo that merge, and I can easily do that, returning to the last unmerged state of branch A. However, I want to merge individual commits made to a branch A+B after a merge. They don’t do anything with files that were affected on branch B, so theoretically it would cause no conflicts. However, when I try to merge this individual commits, I also end up merging branch B as well. How can I merge just the changes made in this precious commits?
Share
You can use
git cherry-pickto select specific commits to apply to the tree.Alternatively, if the merge was not fast-forwarded, you can revert the merge commit: