I have a situation where the remote repository has some "bad" commits. e.g.
... o ---- C ---- A ---- B origin/master
Where A is bad (but B is good) I want the remote to become...
... o ---- C ---- B origin/master
\
A origin/dev
It is not obvious to me how to do this.
In the case where a rebase is inappropriate a different result is needed.
... o ---- C ---- A ---- B ---- ~A origin/master
\
- origin/dev
This results in a dev branch containing the A commit and the master not containing the A commit. The revised question is: How to do an anti-cherry-pick? So rather than generating a patch which changes the repository from state C to A apply a patch which changes B to A.
git reset
orrebase
stackoverflow.com/a/60890028/2338477 – Sweater