Arduino Leonardo stucked

I accidentally uploaded a code without any mention to

void loop() { }

or

void setup() { }

AS a result I uploaded it

int main(void) { 
    ... 
    while(1) { infinite loop }
}

Now I can't upload any code to my arduino because COM port just flashes. There isn't any solution?

Try to connect it, while you keep pressing the Reset button.

Then open and click upload the blink example.

When you say it's done "Compiling" and it is about to start uploading, release the reset button.

That helped me with a similar problem I had.

It did work for me. Thanks! 8) 8) 8)