According to the Datasheet of LM7805 (section Application and Implementation), in some scenarios a protective diode (between IN and OUT pins) is needed to protect the regulator.
Please take a look at the schema below, is the protective diode required? I'm asking because the Datasheet say:
may be required if the input is shorted to ground
But in the schema below, the input pin is not shorted to the ground.
simulate this circuit – Schematic created using CircuitLab
I also tested this circuit on a breadboard and the LM78L05 does not get damaged. During the test the circuit draws ~15mA (seems that 15mA is the current which flow between OUT pin and GND pin).
I want to make sure that the regulator will not get damaged while I'll reprogram the MCU, because while the programmer is connected, the OUT pin of LM7805 will get 5V (while IN pin is floating).
In my opinion in this scenario the protective diode will not help at all, because the input pin is floating (only 2 input capacitors will be charged).