Diodes in LDO schematic
It's a two-diode package for convenience, but the diodes serve two different functions:


The one on the left is providing reverse-voltage protection for the regulator. It keeps current from flowing if the connections to JP1 are accidentally swapped.
The one on the right protects the regulator from excess positive VOUT to VIN differential voltage. Many regulators can be damaged if VOUT exceeds VIN by any significant margin, and the diode makes sure that VIN is no more than one diode drop below VOUT, even if the input power is removed.