Teensy 4.x Factory Reset, AKA: 15 Second Restore - TeensyUser/doc GitHub Wiki
A non-locking Teensy 4.x or a not-yet-locked Teensy 4.x has the built-in capability to reset itself to the factory configuration (by fully erasing and wiping all non-volatile memory, then loading a known-good copy of the LED Blink example sketch). This is beneficial anytime your T4.x appears to be bricked and/or hung. To initiate this factory reset capability, perform the following steps (as paraphrased from the description by Paul Stoffregen, the creator of the Teensy family of products, software, and libraries):
Teensy 4.x has a special restore process which wipes the flash memory and writes a known-good LED blink, the same as when shipped by PJRC. To initiate this, with power applied to the Teensy 4.x, hold the program pushbutton for 13 to 17 seconds. At the 13 second point, the red LED gives a quick blink to let you know you're at the beginning of the 4 second window. Release the program pushbutton within this 4 second window to execute the special restore process.
If your hardware is still intact, you'll see the red LED turn on bright while it slowly wipes the memory. This process takes over 1 minute, so please be patient to let it complete. When finished, your Teensy should reboot and you'll see the orange LED blinking. As when Teensy was new, it will appear to your PC as a HID device (not serial). Arduino IDE should recognize and show it in the menu. Upload should now work once again.
This same 15 Second Restore started with the Teensy 3.5 and 3.6 and works the same though without a second LED the timing was user monitored.