WP posts gone, but still in database?

This is one of those posts that I hope will help others, and help me remember what happened.

I went to show my History 104 class blog to a colleague, but was horrified to see that all the posts and pages were gone. But when I checked the database, everything was still there. (This isn’t always the case — and there’s nothing to be done if they’re not in the database unless you backed up your database.)

First, I used phpAdmin to repair and optimize the database. Then I went into the WP settings.

When I looked at Posts, there were none. Then I noticed there were 44 in the trash. These were my posts, so I selected all of them for a bulk Restore.

Then they were there but in Draft mode. I selected all of them and did bulk Edit to publish.

Now everything is back the way it was before.

And no, I don’t know why it happened.