(From the guy who force-pushed on a personal project yesterday to resolve a situation with multiple remote heads - I am ashamed)
Not to say that doesn't make for a good learning moment.
Commits in git are immutable. They're identified by their hash, so they have to be. What's more they have the hash of the previous commits so the whole chain back to the first commit can't be changed. You can only add new chains.
As a consequence, if your main branch points to commit abc123 and your feature branch points to commit def456 then it doesn't matter if you merge, cherry pick, rebase or dance the fandango, if you point those branches back to those commits, the branches must by necessity look identical to the way they looked before you did anything.
And you can find out where they used to point in the reflog.
To my original comment - having to force-push in order to resolve heads - is there a "correct" way to do this that doesn't feel gross?
Essentially, if you have more than one person making changes to the same piece of code, the method for resolving them is:
1) Pull - gets their changes
2) Merge - puts their changes together with yours and you can reorganize them at that point.
Note, this was done with Mercurial which doesn't have the concept of a stage, so Pull feels like it has a slightly different meaning when you look at it that way. One [suggestion][1] for Git if you want to achieve the same effect - getting a Fast-Forward at the end - is to Rebase, then Merge last.
Part of me knew this, I simply forgot and wanted to get out of this particular hole.
[suggestion]: https://www.atlassian.com/git/tutorials/rewriting-history/gi...
I'm not going to demand you explain more, but if you want to explain more then I'll try to answer the question you had about whether there's a better method.
Also Pull is generally a shortcut for "Fetch then Merge", and just getting changes is Fetch.
It's pretty freeing to realize that it's basically impossible to lose committed code.
It sounds like the grandcomment had a ban against rewriting history across-the-board, which would help make git idiot proof. I love rewriting history, not because it's what I wished I had done but because it's what I am going to want to review when I have to.
Rewriting history is a great way for gitiots to shoot themselves in the foot.