We are using git work flow with a develop branch for integration and feature branches for individual features.
Created a feature branch via:
git fetch git checkout -b new-branch origin/develop
(develop is our working integration branch)
worked on new branch and when ready created pull request back into develop and created a pull request on github and merged.
there were no merge conflicts and now our feature branch lives on develop
Had to do another pull request for tweaks to code
at the end of the sprint we reverted the new-branch out of develop via github - using the revert button on the pull request page.
when we tried to revert the second pull request github was unable to do it, so we reverted this commit manually via:
git checkout develop git fetch git merge --ff-only origin/develop git revert -m 1 commit ##the commit that was the pull request git push
when we did the above step we (unexpectedly) got merge conflicts; which we solved; and now YAY! new-branch is no longer on develop, our commits were reverted.
Now that we have released, we want to continue to work on new-branch and remove the revert which as we understand it there are two different ways to do so.
- revert the commit that removed the pull request
find out the commit prior to where we forked the new-branch and run
git rebase -i --no-ff commit
nether of these are allowing us to re-introduce new-branch into our develop branch.
if you have all the code you want on your release branch you should either:
branch of of that if it has all the changes you need and work on that branch
merge it to develop and then branch off develop if there is code on develop you want to keep
then you can just delete the old branch
I you are wanting to remove the reverted commit, don't. Generally, removing or changing commit history in git is a considered a bad idea https://sethrobertson.github.io/GitBestPractices/#pubonce
finally Git Choose Your Own Adventure is an amazing resource for fixing git follies...