What happened to my world‽ [duplicate]

This has happened to me twice now. I create a world (survival, not hardcore), I play for a week or so, then, one day, when I go to open it, it's gone.

I've went to .minecraft and verified that the worlds are still there and they don't appear to be missing any files.

What's going on and how can I stop this from happening again?

And especially, can I get my worlds back?


If you're closing minecraft in mid-stream while it's writing files then the level.dat file can be corrupted and result in your "world" disappearing. You can repair the world in mcedit to get your world back. =)

edit

For further instructions this video seems to cover things adequately: