Basalt on the ocean floor records the magnetic field of the earth from when it cooled. Since it radiates out from midoceanic rifts and the rate of its creation is known, we can use it as a diary of the magnetic field. Iirc we first figured it out during WW2 doing magnetic bathyometry to help ships navigate.