Reflection phase change

A phase change sometimes occurs when a wave is reflected. Such reflections occur for many types of wave, including light waves, sound waves, and waves on strings.
Optics.
Light waves change phase by 180° when they reflect from the surface of a medium with higher refractive index than that of the medium in which they are travelling. A light wave travelling in air that is reflected by a glass barrier will undergo a 180° phase change, while light travelling in glass "will not" undergo a phase change if it is reflected by a boundary with air. For this reason, optical boundaries are normally specified as an ordered pair (air-glass, glass-air); indicating which material the light is moving out of, and in to, respectively.
"Phase" here is the phase of the electric field oscillations, not the magnetic field oscillations (while the electric field will undergo 180° phase change, the magnetic field will undergo 0° phase change. Vice versa is true when reflection occurs at lower refractive index interface.) Also, this is referring to near-normal incidence—for p-polarized light reflecting off glass at "glancing" angle, beyond the Brewster angle, the phase change is 0°. The phase changes that take place upon reflection play an important part in thin film interference.
Sound waves.
Sound waves in a solid experience a phase reversal (a 180° change) when they reflect from a boundary with air. Sound waves in air do not experience a phase change when they reflect from a solid, but they do exhibit a 180° change when reflecting from a region with lower acoustic impedance. An example of this is when a sound wave in a hollow tube encounters the open end of the tube. The phase change on reflection is important in the physics of wind instruments.
Strings.
A wave on a string experiences a 180° phase change when it reflects from a point where the string is fixed. Reflections from the free end of a string exhibit no phase change. The phase change when reflecting from a fixed point contributes to the formation of standing waves on strings, which produce the sound from stringed instruments.
Electrical transmission lines.
Reflections of signals on conducting lines typically exhibit a phase change from the incident signal. There are two extreme cases of termination: short circuit (closed line), and open circuit (broken line). In both cases the full amplitude of the wave is reflected.
where 
In the case of reactive termination the phase shift will be between 0 and +180° for inductors and between 0 and −180° for capacitors. The phase shift will be exactly ±90° when |"X"| = "Z"0.
For the general case when the line is terminated with some arbitrary impedance, "Z", the reflected wave is generally less than the incident wave. The full expression for phase shift needs to be used,
This expression assumes the characteristic impedance is purely resistive.