The inversion of inhomogeneous physical states has great technological importance; for example, active noise reduction relies on the emission of an inverted sound wave that interferes destructively with the noise of the emitter1, and inverting the evolution of a spin system by using a magnetic-field pulse enables magnetic resonance tomography2. In contrast to these examples, inversion of a distribution of ferromagnetic or ferroelectric domains within a material is surprisingly difficult: field poling creates a single-domain state, and piece-by-piece inversion using a scanning tip is impractical. Here we report inversion of entire ferromagnetic and ferroelectric domain patterns in the magnetoelectric material Co3TeO6 and the multiferroic material Mn2GeO4, respectively. In these materials, an applied magnetic field reverses the magnetization or polarization, respectively, of each domain, but leaves the domain pattern intact. Landau theory indicates that this type of magnetoelectric inversion is universal across materials that exhibit complex ordering, with one order parameter holding the memory of the domain structure and another setting its overall sign. Domain-pattern inversion is only one example of a previously unnoticed effect in systems such as multiferroics, in which several order parameters are available for combination. Exploring these effects could therefore advance multiferroics towards new levels of functionality.