In our team, we maintain flat git history
by rebasing from other branches. And squash-merge from feature
branch to dev
branch.
Mistakenly, I merged a branch into another branch. After merging, I also committed a few changes in the current branch and pushed. Then I found that we don't do that. My current git history looks like this.
As you can see, I don't need that merged commit. I want to remove that commit preserving previous and later commits. If I can remove that commit completely, I can easily rebase that branch again.
How I can do that?
One way could be, didn't try yet though, I can create a new branch cherry-pick the changes, and delete this branch from local and remote.