Recovering 'old commits' from multiple git rebases
Posted
by Benjol
on Stack Overflow
See other posts from Stack Overflow
or by Benjol
Published on 2010-04-22T13:02:28Z
Indexed on
2010/04/22
13:03 UTC
Read the original article
Hit count: 369
git
|git-rebase
I am aware of this question, but not to sure how to map it to my current situation. (Rebase is scary, undoing rebase is double scary!)
I started out with several different feature branches of my master:
master x-x-x-x-x-x-x-x-x-x
\ \ \
FeatureA 1-2-3 \ \
FeatureB A-B \
FeatureC X-Y-Z
I wanted to merge them all together and check they worked before merging back onto the top of master, so I did a:
git checkout FeatureB
git rebase FeatureA
git mergetool //etc
git rebase --continue
Then
git checkout FeatureC
git rebase FeatureB
git mergetool //hack hack
git rebase --continue
Which leaves me with
master x-x-x-x-x-x-x-x-x-x
\
FeatureA 1-2-3
\
FeatureB A'-B'
\
FeatureC X'-Y'-Z'
Then I corrected some bits that didn't compile properly, and got the whole feature set to an acceptable state:
master x-x-x-x-x-x-x-x-x-x
\
FeatureA 1-2-3
\
FeatureB A'-B'
\
FeatureC X'-Y'-Z'-W
My problem is that my colleagues tell me that we're not ready for FeatureA.
Is there any way for me to keep all my work, but also revert to a situation where I can just rebase FeatureC on to Feature B?
© Stack Overflow or respective owner