We are using GitHub as code repository. We started working on some feature a long time ago. Finally we finished the task, and wanted to create a pull request in order the changes to be reviewed. But in order to be able to easily merge the feature branch into the master branch, I decided to merge the things, that have been changed on the master branch, into the feature branch. That is why I created a pull request with "compare" - master branch and "base" - the feature branch. The pull request was created, there was 2 merge conflicts, which I resolved, then I pressed "Squash and merge" and that was it.
But then I saw that feature branch is merged into the master branch, and the last commit in the list of the commits in the pull request is:
"merge branch 'feature/<some feature>' into master"
no matter that the pull request was for the opposite way - it is even written in the pull request :
"iliev-ivaylo merged 7 commits into feature/<some feature> from master".
Why this happened and what is the best way to undo this commit from the master branch? Should I use "git revert" or something else?
The resolution of the conflict went into the branch being merged, i.e. into master.
When using git, the usual way is to rebase the feature branch on top of the master before merging.