Liquid crystals are soft materials that combine the fluidity of disordered liquids and the long range orientational or positional order of crystalline solids along one or two directions of space. X-ray scattering is widely and generally successfully used to investigate and characterize the microscopic structure of most liquid crystals. In many cases however, the Bragg reflections are forbidden by special symmetries of the unit cell and the low dimensional structure of the liquid crystalline phases are out of reach of conventional X-ray experiments. We show in this paper that this problem can be overcome by resonant scattering of X-rays as it reveals the anisotropy of the tensor structure factor. We review various examples in which the restored forbidden reflections reveal unambiguously the hidden structure of liquid crystalline phases. Moreover, we show that in some cases, a fine analysis of the polarization of the Bragg reflections enables one to discriminate between different structural models. These studies solved long standing questions about biaxial liquid crystal structures and provided new insights into physical phenomena such as supercritical behaviour or commensurate-incommensurate transitions.