I get a feeling from my feed lately that not that many kernel dev’s are too familiar with git reflog, which is essential tool for solving exactly the situations of e.g.
git am.git rebase.git cherry-pick.Ignoring git merge because I’ve never used it in my career for any possible kernel dev task ;-)
It is really worth of the effort learn this subcommand properly. You won’t regret the investment.
Reflog a local cache and/or timeline of commit ID change’s at the tip. It is not stored to history and is completely ignorant, orthogonal and disjoint from whatever state the Git tree might be in.