Commits D & E were checked into branch XXX by mistake instead of YYY. We are trying not to use git reset
to solve this.
So we have:
- XXX: A -> B -> C -> D -> E
- YYY: A -> B -> C
We reverted to commit C on branch XXX
git checkout XXX
git revert --no-commit C..HEAD
git commit
git push
This gets you
- XXX: A -> B -> C -> D -> E -> F (F is the revert)
- YYY: A -> B -> C
Then we merged into branch YYY where we wanted to re-establish E as the head (without using reset).
git checkout YYY
git merge origin/XXX
So now we have:
- XXX: A -> B -> C -> D -> E -> F
- YYY: A -> B -> C -> D -> E -> F
Then we tried to reset YYY to E
git revert --no-commit E..HEAD
BUT the revert commit gets you this error:
error: a cherry-pick or revert is already in progress hint: try "git cherry-pick (--continue | --quit | --abort)" fatal: revert failed
Tried using --continue
but that didn't work.
How can we do this?