Not being able to program Arduino uno r4 after using it as a HID device to emulate keyboard

#include <Keyboard.h>

void setup() {
  // Start the keyboard emulation
  Keyboard.begin();
  delay(1000);  // Wait for a moment

  // Press the Windows key (Left GUI) on the keyboard
  Keyboard.press(KEY_LEFT_GUI);

  delay(100);  // Hold the key for a short duration

  // Release all keys
  Keyboard.releaseAll();
}

void loop() {
  // No need for anything in loop, it only runs once in setup()
}

i uploaded this code to run on the Arduino uno r4 wifi. Now whenever i plug the ardiuno back to my computer, it registers itself as an HID device and im not able to program it.

Cannot perform port reset: 1200-bps touch: opening port at 1200bps: Invalid serial port
"C:\Users\adity\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5/bossac" -d --port=COM6 -U -e -w "C:\Users\adity\AppData\Local\arduino\sketches\252D257249B79B9D17A7D66695BABB3B/sketch_apr30a.ino.bin" -R
No device found on COM6
Failed uploading: uploading error: exit status 1

This is the error it gives.

Is there any way i can program it now or is it bricked?
Any help would be appreciated.
Thank You

For the WiFi version you might be able to recover it by following this:

Restore the USB connectivity firmware on UNO R4 WiFi with espflash – Arduino Help Center

You can give a quick double tap to the reset button until you see the on board led fading in and out, at that point the board should be found by the ide again

This works! thanks
I feel it is better if its mentioned in the keyboard hid tutorial. just a suggestion.
thanks

you can find that note here https://docs.arduino.cc/tutorials/uno-r4-wifi/usb-hid/#sketch-upload-interference