Recover from (nearly) anything, using Git

For some reason, you were sure your rebase had gone right, and you pushed to origin. Or perhaps you reset --hard, but on the wrong commit. Then pushed -f to origin.

But you were wrong. And since you were the only dev on the project, everything you did in the last 4 weeks is now gone.

Absurd, I know. It shouldn't be possible. I agree. But now that we've said that, what should we do? Fixing the process won't recover those weeks of work.

Well, fret not, because your cause might just not be lost. How do I know? I've been there myself. Ten minutes ago.