So now that you are able to upload again I suggest that you add a safety mechanism to your code so you don't encounter the problem again.
The basic idea is to use an input (with INPUT_PULLUP). Only if that input is pulled low (wire, switch) you allow your program to use the HID functionality.
Keyboard press how it works? - #12 by sterretje contains an example how you can omplement it.