Yes. We can see evidence of magnetic polarity reversals by examining the geologic record. When lavas or sediments solidify, they often preserve a signature of the ambient magnetic field at the time of deposition.
Incredible as it may seem, the magnetic field occasionally flips over! The geomagnetic poles are currently roughly coincident with the geographic poles, but occasionally the magnetic poles wander far away from the geographic poles and undergo an "excursion" from their preferred state. Earth's dynamo has no preference for a particular polarity, so, after an excursional period, the magnetic field, upon returning to its usual state of rough alignment with the Earth’s rotational axis, could just as easily have one polarity as another.
These reversals are random with no apparent periodicity to their occurrence. They can happen as often as every 10 thousand years or so and as infrequently as every 50 million years or more. The last reversal was about 780,000 years ago.
Reversals are not instantaneous; they happen over a period of hundreds to thousands of years, though recent research indicates that at least one reversal could have taken place over a period of one year.
The USGS film Secrets in Stone tells the story of how records of magnetic reversals helped lead to the evolution of the plate tectonics theory.