download lost program

What gets downloaded into the arduino is the compiled HEX output file that the uC runs - if you read it back, it is not something you can edit anymore to make changes to.
You need to get in the habit of pressing Save before you compile & download.