Thanks for admitting this happened to you. I have accidently deleted my work several times, and it's usually one of my better pieces. Usually there is a way to "refind" it. I'm glad it worked out for you!
I think stuff like that happens when we are typing something long, or have too many windows open. I have a bad habit of writing late at night, and I do all kinds of loopy things I would never do in the daytime. I never proofread at night now, because whatever looked fine the night before normally has several mistakes in it. I also keep my flashdrive in when I write, since I know I have a tendency to be a klutz, and have lost things. It's my "safety net."