there are two things here :
First you could be the victim of a bug in Arduino-0017 which ios fixed in Arduino-0018
And secondly (not arduino related) :
HOWEVER sometimes i am in a rush so i just hit save then pull the plug when it says it is saved
No modern Operating system allows you to pull the plug, you have to
shut down the computer in the normal way otherwise you corrupt your data.
If you are in a hurry very often get that battery back into your laptop so you can send it into hibernate state.