Is a revert of the original feature branch, add the new changes here,
and then merge them again in Dev, using a new pull request the best
way to add the new changes?
Based on my own, strongly agree with the opinion that above comments mentioned. As what you want to achieve, I don't think use revert
is a good idea. Because it actually will make a mess to your repository at last.
As you said in comment, after revert
, you have to re-do the all changes to feature
branch which includes the one was merged previously but cancelled later. Its advantages is it can assure the integrity of your repositories history. But I don't think it would be a best way in your scenario.
To more great for explanation, originally, the pull request was merged feature
branch into dev
branch, then you found you need add another changes to one of file.
So, why not direct make this new change into feature
branch, then do push it into dev
branch again?
As what you concerned, if you create a new branch to make apply your new change, it will cause trouble when they need merged onto further branch, because you must keep them sync with each other, or it will cause conflict easily.
Another, if create a new branch is the choice you have to make. You can create this new branch based on feature
branch. After the new change applied into the file, merge the new branch into feature
branch via pull request. Then merge the feature
branch into dev
branch.
At this time, the new branch can be delete since all of changes are all sync back to feature
branch. Also, you can continue work on feature
branch later.
What does it mean and how can I check the conflicts?
There has one other thread explained it very detailed. You can check that.
To solve that, you can try with below script:
# Unstage conflicts
git reset HEAD ./
# Unstage deletions and reset everything back to master
git checkout -- ./
# Cancel the pending revert operation
git revert --abort
$ git checkout 8a750f
# Make use of tag feature, it can help for this kind of issue in the future.
$ git tag mark
$ git push origin mark