The branch started too late, change the parent of my branch

I have the following situation:

A---B---F---G---H (master)
     \
      \
       C---D---E (experimental)

My problem is that B is very, very bad, which should not have been on master. It belongs to experimental. However, F --- G --- H is fine. Is there a way to make it look like this:

A---F'---G'---H' (master)
\
 \
  B---C---D---E (experiment)

I read about rebase and the like, but the biggest problem is what masterwas clicked on origin.

+5
source share
2 answers

git rebase --onto A B master.

, orgin, , , git push -f . , , , .

, , , B , , , - , B , , .

rebase, , , , .

+3

:

git revert B

, (.. commit B , , . .)

:

A---B---F---G---H---I (master)
     \
      \
       C---D---E (experimental)

I - . , B, B.

, I, .

+5

All Articles