By means of powder neutron diffraction we investigate changes in the magnetic structure of the coplanar non-collinear antiferromagnet Mn$_3$Ge caused by an application of hydrostatic pressure up to 5phantom{ }GPa. At ambient conditions the kagome layers of Mn atoms in Mn$_3$Ge order in a triangular 120$^{circ}$ spin structure. Under high pressure the spins acquire a uniform out-of-plane canting, gradually transforming the magnetic texture to a non-coplanar configuration. With increasing pressure the canted structure fully transforms into the collinear ferromagnetic one. We observed that magnetic order is accompanied by a noticeable magnetoelastic effect, namely, spontaneous magnetostriction. The latter induces an in-plane magnetostrain of the hexagonal unit cell at ambient pressure and flips to an out-of-plane strain at high pressures in accordance with the change of the magnetic structure.