I have a branch called feature which branches off main at commit F, with two commits, A and B.
This was merged with a merge commit, M, and then the merged was reverted with commit R.
I now want to rebase branch feature so it's on the tip of main, with its commits A and B again, (so I can carry on working on it and fix the problem that caused the revert to be needed).
However, when I do git rebase main, git just fast-forwards me to the tip of main, presumably because it sees that A and B are already on main.
How do I force this?
I've tried git rebase --onto main SHA_FOR_F --no-ff but that does the same thing.
Here's the situation:
R - main
|
M
|\
| B - feature
| |
| A
|/
F
|
and I'd like:
B - feature
|
A
|
R - main
|
M
|\
| B
| |
| A
|/
F
|
I know I could just cherry-pick A and B individually, but is there a way of doing this in one go?