Erase or reset my arduino

By some reason, I wrote this code below and upload it into my arduino, and obviously, I forget a delay function in loop method(How foolish I am!).

So, every time I pin the arduino into my computer, the simulated keyboard is always input something and can never stop.

I want to erase or reset my arduino, but how can I work it?

The type of board is Leonardo Micro Mini.

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:
Keyboard.print("Hello.");
}

Thx.

I recall you could hold the reset button until upload of empty sketch starts?

(no guarantees :wink:

yep, I have tried to reupload my code into arduino, but the IDE is blocked up on 'uploding' status. Maybe the computer has received too much keyboard signals from usb interface so that can't make regularly communication with my board?

You might try it this way - http://www.arduino.cc/en/Tutorial/ArduinoISP -

but you need a second Arduino for that

Hold down the Reset button.
Disconnect the USB cable to flush the buffers.
Re-connect the USB cable.
Start an upload.
When you see the "Global variables use xxx bytes (xx%) of dynamic memory" message, release the Reset button.