Troubleshooting arduino Leonardo micro

So i have a problem with my arduino leonardo
I have been playing arround with it and tryed to emulate a keyboard
and then i thaught i could use a button to then pres ALT F4
End of story : everytime i Plug it in it automaticl spamms ALT F4

is there a way i can reset it ??

Do this:

Unplug your Arduino board from your computer.

Open the sketch you want to upload.

Select the appropriate board from the Tools > Board menu.

Hold down the reset button on your Arduino board.

Plug your Arduino board’s USB cable into your computer.

Sketch > Upload

Watch the black console window at the bottom of the Arduino IDE window. When you see something like this:

Sketch uses 3462 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.

release the reset button

The upload should now complete successfully.