32U4 boards can be reset by opening and closing the serial port with a baudrate of 1200 which will activate the bootloader so you can upload.
Part of the code that you upload is responsible for that; if your code has a flaw, it can affect that "reset" code and you can no longer activate the bootloader by opening and closing the serial port with a baudrate of 1200.