When a wave is incident normally on a rigid boundary, then assuming there is no absorption of energy by the boundary, the reflected wave has the same shape as the incident wave but it suffers a phase change of π or 180∘ on reflection.
This is because the boundary is rigid and the disturbance must have zero displacement at all times at the boundary.