Actinide materials exhibit strong spin–lattice coupling and electronic correlations, and are predicted to host new emerging ground states. One example is piezomagnetism and magneto-elastic memory effect in the antiferromagnetic Mott-Hubbard insulator uranium dioxide, though its microscopic nature is under debate. Here, we report X-ray diffraction studies of oriented uranium dioxide crystals under strong pulsed magnetic fields. In the antiferromagnetic state a [888] Bragg diffraction peak follows the bulk magnetostriction that expands under magnetic fields. Upon reversal of the field the expansion turns to contraction, before the [888] peak follows the switching effect and piezomagnetic ‘butterfly’ behaviour, characteristic of two structures connected by time reversal symmetry. An unexpected splitting of the [888] peak is observed, indicating the simultaneous presence of time-reversed domains of the 3-k structure and a complex magnetic-field-induced evolution of the microstructure. These findings open the door for a microscopic understanding of the piezomagnetism and magnetic coupling across strong magneto-elastic interactions.