  The local electronic and magnetic properties of superconducting FeSe have
been investigated by K$\beta$ x-ray emission (XES) and simultaneous x-ray
absorption spectroscopy (XAS) at the Fe K-edge at high pressure and low
temperature. Our results indicate a sluggish decrease of the local Fe spin
moment under pressure up to 7~GPa, in line with previous reports, followed by a
sudden increase at higher pressure which has been hitherto unobserved. The
magnetic surge is preceded by an abrupt change of the Fe local structure as
observed by the decrease of the XAS pre-edge region intensity and corroborated
by ab-initio simulations. This pressure corresponds to a structural transition,
previously detected by x-ray diffraction, from the $Cmma$ form to the denser
$Pbnm$ form with octahedral coordination of iron. Finally, the near-edge region
of the XAS spectra shows a change before this transition at 5~GPa,
corresponding well with the onset pressure of the previously observed
enhancement of $T_c$. Our results emphasize the delicate interplay between
structural, magnetic, and superconducting properties in FeSe under pressure.
