Reputation: 966
I did something stupid similar to this question: Stackoverflow question
Let me summarize it quickly:
I created a branch1 from master - did some changes - then created a different branch2 from master to do a hotfix - then i did a rebased branch1 onto the hotfix/master - and I got duplicate commits in my branch1.
Now I know i should've merged it - but how can I undo these changes? Here's a Picture of how it looks - the red rectangles are the duplicates.
Upvotes: 1
Views: 1516
Reputation: 8345
git checkout 2536bae
git branch branch1 -f
git push origin branch1 -f
Then inform colleagues that they should throw away their branch1
and pull it anew. If they also have made commits, they can fix the issue by cherry picking their own commits after getting your fixed version and proceeding as usual.
Upvotes: 2