I royally messed up the git repository of one of my projects and need help fixing it.
This is what I wanted:
alpha E--
/
master --A--
|\
beta | B--C--
\
gamma D--
Four branches total, 3 unstable branches and a master.
Somehow, however, I created an accidental merge, then another bad merge when I tried to undo it. So now my repository looks like this:
master --A--E--------Y
| / \
beta | X--B--C Z--C'
\ /
gamma D--B?--C?
With no alpha branch at all (somehow, even though I definitely did a git checkout -b alpha
), with the beta branch in a state of very weird reversion, and with the gamma branch having the commits of the beta branch on it without any apparent merge.
Luckily I know exactly what each file should look like on each branch and I can rewrite history on the remote for a couple more weeks before my team returns to action.
How can I make my 4 separate branches instead of my merged mess without losing work?