I started with the master branch along with few other developers and we are following a nice workflow where we create a new issue specific branch, merge it back to develop and after few features merge develop to master.
Some times we also do hotfixes in master but then merge master into develop to avoid future merge conflicts.
The Problem
At some point, I merged master back to develop but while solving merge conflicts, removed some code that was done in develop . Now we realized the problem that was created so Now we need to undo that specific merge.
So, let me share some info with you.
master
- hotfix-1
- hotfix-2
- hotfix-3
- merge develop
- revert merge develop
current state : ok
develop
- started from master
- work a
- work b
- merge work from test_1
- merge work from test_2
- merge master into develop
- work c
- work d
- work e
If you are concerned by the chronological order, the last 2 commits of the master are the latest changes.
What I wish
I hope there is an option to revert the merge as I am completely blank.
Options:
- I tried reverting, but turns out you cannot revert a merge commit
- I thought I can create a new branch from the commit before the merge and then replay the changes after the merge and then merge the new branch back to develop. Is this possible ? will it allow me to continue our workflow ??
An important point is that I might not be getting the full picture, as I just read that after merge both branches share the history and when I go to commit hash in bitbucket I see master in all the commits. I am guessing commits have been transferred to master.
Any help or insights will be greatly helpful. thanks.