The aim of this paper is to provide spatially resolved distributions of residual stresses. X-ray diffraction measurements provide an intrinsic average of the residual stress due to the diffracted volume analyzed during the measurement. When the irradiated area is higher than the characteristic length of stress gradients, strong averaging effects are observed. A spatial deconvolution technique is developed to reconstruct the local residual stress field, based on the inversion of a linear system constructed from the average datasets. The method is first applied to the reconstruction of residual stresses in two reference cases inducing heterogeneous plastic strains (laser shot peening and repetitive corrugation and straightening processing), in which the average datasets are constructed from the local stress profiles determined numerically by the finite element method. In both processes, a very good agreement is observed between the reference stress profiles and the reconstructed ones. Finally, the method is applied to experimental X-ray diffraction measurements on a specimen processed by repetitive corrugation and straightening in similar conditions than the numerical simulations. A strong averaging effect is observed on the collected data and a good agreement is observed between the local stress profile reconstructed from the experimental measurements and that predicted numerically.