How to undo a git push --force and undelete things

Today someone asked for my help to undo a git push --force that messed up his production server by overwriting the master branch with something that wasn’t meant to be there. My first advice would be to not deploy to production servers by manually running git pull or git push, but that’s another story and I briefly mention it in my post on basic rules for software deployment. So how would you solve the situation? »