Committed my feature into master, now I have two feature branches!

So I was testing merging and conflict resolution when I accidentally committed what I was supposed to commit into feature branch, into master branch!
Now I have two feature branches! I was quite sleepy, so instead of researching how to resolve this issue, I tried to reverse commit! And it made things worse!
So I’m not so sure how can I fix this mess I created, what I had in mind after the committing mistake, was to just delete the new commit and everything will be fine. But seems like revert didn’t exactly do what I desired.
Also, as you can see, the master has been replaced with the features branches. I understand what Ben once said about them just being pointers, but how to re-point them?
Is it better to start off clean? But what would happen if I made this mess mid-project :'D?
Thank you!

[UPDATE] So now that I’ve seen the revert/reverse commit video, revert seems to bring out the data, but not the history, so the history is still messed up, and moreover, I still don’t get what switched the master and feature branches!

[UPDATE] I was thinking of somehow re-downloading what was on my remote repo and get back to using it, instead of starting all over (hopefully with the old history too), is there a way to do that?

[UPDATE] I was thinking of reverting to pre-branching, aka the “Green ground and red cube” node. But will this also revert my master and features branches to correct pointers? Guess it can’t get much worse than what already happened, right?

[SOLUTION] Tried for a few hours to fix things and couldn’t, so I deleted everything and cloned from the latest safe remote commit I made. Not the most professional way to do it, but I had to keep moving. I’ve retried merging and it worked fine this time.


Thanks for sharing your solution. :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.