I tried to split a big commit which was already pushed in a smaller one following How can I split up a Git commit buried in history?. Now, I made some other changes as well and discarded some useless modifications.
Now I tried a push request, but it failed because I've accidentally removed those commits during rebasing instead of reverting them. git status
shows:
$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 15 and 2 different commit(s) each, respectively.
#
nothing to commit (working directory clean)
I already tried cloning the repository, reverting that commit and pushing it. Next, I pulled upstream in my working directory. That does not work and is basically applying my new modifications and then reverting everything again to the old state.
How can I insert those 2 commits (fast-forward?) before my commits with a revert commit after it? Do I need to do another rebase?
My commits looks like this:
A - B - C origin/master
\
D - E - F local working copy
I want it looks like this:
A - B - C - revert_B - D - E - F