in reply to Have you ever lost your work?
My source code is almost always in a git repo, so the answer is usually no. However, I did (attempt) to go into the crontab editor recently, but used the -r argument instead of -e (they're right next to each other on the keybowrd), and ended up deleting the entire crontab, about 500+ lines of useful stuff.
Fortunately, Past Me had a job that ran twice a day that saved crontab to a file called crontab.latest, and I was able to easily recover. Past Me has made some blunders, but there have also been some clever moments.
If I'm writing anything of size or complexity, I just add it to the local repo. Creating a repo is super easy (it doesn't have to be pushed to the cloud), and then you can create a branch, go off and try something weird or different, secure in the knowledge that the original lame (but working) version is available if you need.