I have a development branch that I accidentally merged into the Master branch before it was ready.
As I did this in error, I decided to revert the changes in Master so that none of my changes where there. This process created a Revert Commit that removed my changes from Master.
All was good I thought...
A week has now passed and I'm nearly ready to merge my branch back into Master. As there are other developers working on other branches, I decided to update my Development branch by merging any new changes from Master back into mine.
This process seems to delete all of my work.
Reviewing the history of what has just come from Master, it contains the accidental commit and the revert commit. This means that whenever I update my branch from Master, the revert commit is deleting the majority of my work.
How can I merge the changes in master back into my branch but without including the revert commit?
The only 2 possibilities I can think of are:
- Go through every item in the Merge and attempt to manually remove the revert items (this I think would be impossible to do correctly and a complete nightmare to get right).
- Copy all of the files I have made changes to locally, merge from Master and then attempt to copy/paste all the changes back into my branch (this would probably also be a nightmare to get right).
I'm hoping there is a better automated way to do this (I'm hoping for some sort of Merge but ignore certain commits process).