Stuck with bad sketch
This very much looks like the Serial-over-USB-Driver has chosen another port than COM5 on reconnecting the board. Assuming you are using the Arduino IDE, check whether COM5 still shows up in the Board -> Port menu -- or, in other words, go there and select the port that is listed there while the board is plugged in.

Usually, I'd expect this port to be COM3 on Windows, but that may change when you...


physically disconnect and reconnect the board too fast (i.e. the driver has not yet shut down the old COM port when a "new device on USB!" event comes in) 
still have the Serial Monitor open when disconnecting and reconnecting (because the driver cannot remove the virtual COM port device while the Serial Monitor has it opened, in which case the driver creates another virtual COM port device on a different number)
disconnect and reconnect while the esptool process is still working (same reason as above).


It also might help to enable verbose output for compiling and uploading (see preferences dialog in Arduino IDE).