0

I seem to have ended up in some sort of git grey area that I don't know how to solve.

Situation: I worked on 2 independent features from the development branch yesterday, however, I forgot to switch to the development branch before checking out the 2nd branch. Hence the changes from the 1st feature were committed to the 2nd feature. I solved this by doing a git revert.

Yesterday I pushed the first feature to development, and today before pushing the 2nd feature to development I did "git pull origin develop" in order to pull the latest changes from development. But the files that were affected by the revert, don't update to the latest changes from development. I believe due to the revert?

How does one solve this?

octavemirbeau
  • 481
  • 6
  • 19

1 Answers1

0

You can give either of the following two approaches a try:

  1. In case branch 2 has very few commits, you can cut a new feature branch from the updated development branch and cherry pick your changes into it. https://stackoverflow.com/questions/9339429/what-does-cherry-picking-a-commit-with-git-mean#:~:text=Cherry%20picking%20in%20Git%20means,to%20apply%20the%20commit%20to.

  2. You can revert the 'revert' commit i.e. the commit id for reversion of the branch 1 changes from branch 2. So your branch 2 would now be in sync with the development branch. Do a pull from development after that. In worst case scenario you would have merge conflicts to resolve.