Diodes can also be used to pass the higher of two voltages without affecting the lower. A nifty example is shown in figure 4.13 The 12 V battery does nothing until the power fails; then it takes over without interruption.
Figure 4.13: Diode OR gate.