I'm working on a develop branch and two different (local) feature branches.
a -- b -- e <-- develop
\ \
\ f -- g <-- feature-branch-1
\
c -- d <-- feature-branch-2
I incorporated the changes from feature-branch-1 into feature-branch-2 by running
git checkout feature-branch-2
git rebase feature-branch-1
If I understand it correctly, it now looks like this:
a -- b -- e <-- develop
|\
| f -- g <-- feature-branch-1
\
f -- g -- c -- d <-- feature-branch-2
However, I then realised that I introduced an error in branch 1 that I don't know how to fix yet. So this error is now in branch 2, too, and prevents me from merging feature-branch-2 into develop. I want to go back to the original state
a -- b -- e <-- develop
\ \
\ f -- g <-- feature-branch-1
\
c -- d <-- feature-branch-2
so that I can safely merge feature-branch-2 into develop. How can I achieve this?
develop
and usegit cherry-pick
to take only commitsc
andd
. – Lobulec
andd
worth keeping, this would be acceptable. If I were working on a long-running feature branch, picking commits individually would not be acceptable. I appreciate your help though! – Deviled