I have a branch off of master, called A, that I wanted to create a new branch off of, B. Except I messed up and created B off of master.
Desired:
master
\
A
\
B
Actual:
master
\ \
A B
B only has one commit that I need, but because it was based off of master and not A the diff is huge. To make things worse, I tried git rebase -i A
and squashed everything except for the one commit I wanted seen, but this seemed to just rebase off of master again. So now I have a reflog that basically looks like this:
B@{0}: rebase: B onto master
B@{1}: commit
B@{2}: rebase: B onto master
B@{3}: branch B created
What I need to figure out is how to get just the one commit out and base it off of A so that I can make a pull request where the diff isn't huge.
Edit: might be good to note that A is not up-to-date with master, it is still many commits behind. So the erroneously rebased B is now "ahead" of A.