Windows and Linux can't recognize device (Arduino Leonardo)

Hello there! I've bought this Micro Arduino Leonardo:

As I received, I began my testing with the Keyboard and Mouse libraries. But, the genius here created various instances of the Keyboard_ and Mouse_ classes in these libraries, and now Windows and Linux doesn't recognize it anymore, also, I can't upload new code to it because the port seems to be blocked. Is there a way to fix it? I don't have any another arduino capable of 5v

You can try connecting an ISP programmer to the ICSP header on your Leonardo and then do a Tools > Burn Bootloader. If you don't own a dedicated ISP programmer you can use an extra Arduino board as an "Arduino as ISP" programmer.