Arduino lost the uploaded sketch after being on for 7 months?

I have come across a weird scenario. I had a little standalone device using an Arduino Nano and an ESP8266 that was powered from a wall wart and that sent packets every few seconds.

It worked just fine since being put in service, roughly for 7 months. Then one day it stopped sending packets. Power cycling did not help.

I looked at the Arduino, and the L was blinking at 1 second interval. It's as if the blink sketch that it came with from the factory was loaded. I connected it to a computer via USB to see what was going on through the serial. No data came across the serial.

Then I uploaded the blink sketch again, and everything worked just fine. Then I re-uploaded the sketch for my device, and everything is working fine.

What happened? :astonished: