0

We have a dev branch, and a separate feature branch which I've been working. Using GitHub's UI, I've accidentally merged the dev branch (and all it's new commits) into the feature branch.

I want to purge all of the dev branches changes. I thought about creating a new branch, then just cherry picking from the feature branch given the mess this has created.

Here is the Git log graph if that helps.

| *   14d6767 (origin/feature/) Merge branch 'development' into feature/
| |\
| |/
|/|
* |   2d88b27 Merge remote-tracking branch 'origin/master' into development
6

1 Answer 1

1

You could:

  • git reset commit_before_merge
  • git checkout commit_before_merge followed by git checkout -b feature/this_works, and then, optionally, cherry-pick in any other changes that look OK

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.