Sketch on Arduino deleted?

Hi, I've been programming a sketch and in the middle of testing it, the Arduino froze, deleted the sketch, and loaded the standard Blink sketch. I tried reconnecting it to my computer, but LED 13 was still blinking. It's not a problem, I can just reupload it, but I'd like to know how this happened.

I'm using an Arduino Mega 2560.

By "the Arduino", do you mean the Arduino IDE or the Arduino Mega 2560?

I mean the Arduino Mega 2560

The Mega itself can not load any sketch. Is what you observed indeed the blink sketch (1 second on, one second off)? Or can it be the short flashes of the bootloader on the Mega waiting for upload (I assume that that behaviour is te same as on the Uno)?

Delta_G:
Hang on, so you say you loaded the blink sketch and now you wonder why the blink sketch is running?

It read to me like the OP thinks the Arduino loaded blink somehow:

the Arduino .... loaded the standard Blink sketch.