Post the code that caused the issue. It does not help to tell people not to do what you did without knowing exactly what you did
You might also have a chance that somebody can point out a possible error in your code.
User code should not affect the upload capabilities of the board; I'm surprised about that.
I had a very wierd problem with a MEGA2560 board. I put a 128x64 VFD display and a DS3234 RTC on it. Works fine.
Then I wrote a small C program to send the correct time to the RTC chip from my Linux pc.
The RTC code in the Arduino grabs the time data, then sets the RTC. Then it sets the watchdog timer to 500 msec and waits in a while(1); loop to reboot the board.
At this point the board locks up and RESET DOES NOT WORK!!!.. I put the scope on the reset line and verified that the pin does indeed go low when I press reset.
The ONLY way out is to power cycle the board!
If I change the reset code to clear the proper registers and then jump to 0x0000 it resets and works fine.
How can ANY type of crash physically disable the reset pin?