git reflog

If you lost a commit in the sea of commits or accidentally made a commit to a detached HEAD

git reflog

(half a year later, I have no clue what the problem was, nor how this solved it 🤷)