I feel the Arduino IDE like a liar, It's interface alway show your new-version code ,and write new-version code to board, but don't save a bit in hard drive. If u close it, there is no warning to tell your save your work.
It is a so easy to add a function to remind users save work. I think I'm not the only one who has this trouble.
I use version 1.05
It asks me politely if I want to save before closing.
You should look at the bright side of it.
A lot of people could have been telling you to "save your work with regular intervals" for far longer than three hours. And you probably would not do it anyway.
Now you have learned something, and you will remember it.
Learning something that will do you good in the years to come, is a very valuable thing.
If you have a new version of the IDE, it probably asked you, and then you have also learned to be aware of, what your software is trying to tell you.
...... And should you learn to spell "you" with three letters (YOU), you will have learned three things today, and you have achieved something marvelous!
(And if you are using an old version of the IDE, "It is not that bad to keep my software up to date" is the fourth valuable lesson)