I will try my best to concisely describe my current situation, and would be most grateful for some advice.
I merged in a big feature branch of code this morning that turned out to have a critical error. In order to undo it, my coworker reverted the merge (which had several commits) in GitHub and after pulling, all appeared to be well.
After making some tweaks to the feature branch, I wanted to make sure it could go in again, so I used 'git merge master' on my feature branch (like I always do) to make sure everything is up to date.
Surprisingly, the result of that was to delete all of the new code that I am needing to merge back in to the master repo!
Is this due to the revert that occurred on the branch? Looking through the git log, I can see that all of the commits are there still. And even more strange, the pull request in github doesn't show any of the original commits in the diff, only what I have changed since the revert.
Can someone help me make sense of this?
I know some people have suggested simply reverting the revert, but I need to go back in clean, as the changes I made deal with the structure of much of the code.
I ran into this very same issue once. My solution that worked was to "revert the revert" before merging master back into my branch.
What that does is leave you with all your changes, including the new fixes that you've got.
git checkout master
git checkout -b master-with-revert-revered
git revert <revert commit id>
git checkout fixed-branch
git merge master-with-revert-revered
After that, your fixed-branch should be directly mergable back into master with no problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With