cannot revert in Azure Devops

10,105

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
Share:
10,105
CMorgan
Author by

CMorgan

Updated on June 08, 2022

Comments

  • CMorgan
    CMorgan almost 2 years

    I merged a pull request into our dev branch, but there needs to be an additional change to one of the files. I want to revert the pull request, and then add the changes to the feature branch, but when I use the revert button in Azure Devops in says:

    Encountered conflicts when reverting commit '8a750f'. This operation needs to be performed locally.
    

    Very uninformative, and nothing to point out what or where the error is.

    My first question is: 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? Or should I add the new changes into a new branch and push that branch into Dev? My main concern is then how do I push these two feature branches (the one already merged with Dev and the new one) onto further branches, like Test and Master?

    Second question is about the error message: What does it mean and how can I check the conflicts? I work with Visual Studio 2019, and .Net Core 2.2.