The deformation behavior of the magnesium base alloy AZ31 was studied by means of energy dispersive diffraction using high energy synchrotron radiation. The investigations were performed at the EDDI-beamline operated by the Hahn-Meitner-Institute at Bessy II, Berlin. In-situ stress analyses were carried out for samples subjected to purely elastic as well as elasto-plastic 4- point-bending. In addition reversely loaded states were investigated. The results impressively illustrate the potential of the energy dispersive diffraction analysis processed in transmission mode for residual stress analysis of challenging material states. Inhomogeneous loading and residual stress distributions with respect to the bending height of the prestressed bars were determined for the highly textured material state indicating different predominant deformation mechanisms during tensile loading and compressive loading, respectively. After load inversion also the predominant deformation mechanisms reverse.