Suppose that you had started an interactive rebase:
git rebase --interactive HEAD~20
and by mistake, you squashed or dropped some commits that you didn't want to lose, but then completed the rebase. To recover, do git reflog, and you might see some output like this:
aaaaaaa HEAD@{0} rebase -i (...