The Earth's magnetic field occasionally undergoes a spontaneous reversal in which the north and south poles switch places. The mechanism of reversals are still not completely understood, although simulations on supercomputers have been able to reproduce them. These reversals happen very fast geologically speaking.
How do we know reversals must happen fast? (I mean geologically fast)
Click here to see if you are right!
Below are some snapshots from the Glatzmaier-Roberts model of the geodynamo, which was first published in 1995. This model successfully reproduces the intensity of Earth's field, its dipole character, and its present westward drift. It has also undergone a spontaneous reversal, as shown below (Figures from Glatzmaier and Roberts,1995).
We still don't have a perfect understanding about how the outer core's convection has sustained the field for at least 3,500 million years, but being able to simulate the most obvious features of the Earth's field correctly is an awfully good start.
Geomagnetic epochs in time
Below is the 1999 Geological Society of America geologic time scale chart. The main thing I want you to see on this chart is that the periods of normal and reversed polarity have been marked so that they correspond with various ages on the time scale. These periods of time have mostly been set by careful correlation of marine floor magnetic properties.
In the Flash movie below, I point out the markings indicating episodes of normal and reversed polarity as shown on the 1999 GSA geologic time scale.