I have git timeline like this:
- master
- feature-1 -> merged (to master)
- feature-2 -> merged (to master)
- feature-3 -> merged (to master)
All those features happen sequentially (First feature-1. Once it's completed finished, then feature-2, and so on).
Feature-2 is "conflicting" with Feature-1. Conflicting not in the sense of git conflict, rather featurewise.
Now the client decided they prefer feature-1, so we need to pull it back from the dead.
What is the safest and most efficient way to have a new branch that includes feature-1 + anything else in master (feature-3 in this case), excluding feature-2 ?
One alternative I come up with is:
- git checkout feature-1
- git checkout -b yeahbaby
- git merge feature-3
But then you need to know all the branches (in this case it's easy, only feature-3). But in real case you have many of them.
EDITED: beside, it wouldn't work... becase feature-3 is based of master, which carries all the changes in made in feature-2 (which has been merged to master).