Azure DevOps - error when trying to create a PR

I’m getting the following error when trying to create a PR:

> TF401175:The version descriptor <Branch: feature/improve-build-release-pipeline > could not be resolved to a version in the repository ACDC
I have deleted feature/improve-build-release-pipeline on Azure DevOps. Then I also deleted that branch in my local repo, after first checking out the main branch. At this point I’m stuck and don’t know why.

I should mention that I also did a git pull

You deleted the branch before or after getting this error?

if I remember correctly I deleted the remote branch first, then the local branch.

So you deleted your branches before completing the pull request??

Yes, I deleted the branches individually, before trying to create a pull request

What I did was deleted the feature branch in Azure DevOps Services when I performed a PR to move my changes from the feature branch to the main branch. That action deleted the feature branch. (It must be a policy configured by default, because I didn’t configure that. Actually, I thought it a good idea, so I am OK with it.) Then, later in the day, I got into PowerShell locally, then issued a git pull to bring down all of the changes. I edited the YAML file in the Main branch, believe it to be the only branch I had locally. At that point I tried to push my changes back up to remote. However, because of the recommendations made here yesterday about creating a branch policy, the attempt to push my changes to Main failed. I’m sure because of the new branch policy. The error I got, when I tried to push my changes to remote, indicated that there was a feature branch locally. I don’t recall creating the feature branch locally, so I was surprised. (Everything I was doing, in this case, was editing the YAML build file, I didn’t think that I needed it locally. But obviously, I must have created the feature branch locally at some point, probably a month ago so I’d forgotten I’d done so.) At this point I realized I had a problem. I’d deleted the feature branch in the remote through the browser while logged into Azure DevOps Services. And I’d forgotten that I had a local version of the feature branch. So, I then thought all I needed to do was delete the local feature branch. Only now Git probably thinks it wasn’t to notify the remote that the feature branch is gone, but it can’t because the remote doesn’t have it, either. ARGH!!! Although I’ve been using Git for about 3 years, there are still times when what I expect to happen is wrong.

Git locally will not delete the branch remotely, so it must be something else.

What do you recommend should be my next step(s)?

Next steps to accomplish what? You already merged the branch right? Just checkout main update your local branch from remote and create a new branch when you need to make more changes

No, I have not been able to either push to remote or get the pull request to work. What I get, when I try to push to remote is this error:

> Error: failed to push some refs

You said you created a pull request

And after fulfilling the pr your branch was deleted

This is normal, and this means your branch has now been merged with main

You’re correct. I was mistaken. Now I’ve got a local commit, which I can’t put the main. I’m going to try to do a git reset --hard HEAD~1 to revert, and I hope remove, that last commit. If that’s successful, then I’ll branch main, do the changes I was trying to do, create another PR to merge my changes back into main.

The git reset worked. Now, I presume I’m going to have to push the new local branch to a remote branch by the same name, so I can issue a PR