Sketch on Arduino deleted?

epelectronics:
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.

Hang on, so you say you loaded the blink sketch and now you wonder why the blink sketch is running? It's running blink because you loaded blink. That replaces whatever you had on there. It will continue to run blink until you load your code back on it.