mettersi le mani nei capelli

Etymology
lit. 'to put one's hands on one's hair'.

Verb

 * 1) to tear one's hair out; to lose heart; to lose faith; to despair