I just lost a first version of some assembly code I wrote on my Apple II through my own mistake: my code wrote to the part of memory where the assembler kept the source code. When it seemed to work (I hadn't noticed I'd lost my code yet) I saved this (corrupted) version of the code to my floppy, corrupting even the floppy. I had to write the same thing from scratch again, but this time with the full understanding of the problem in my head, and I think the rewritten version is better because of that.