What does ‘Keep your hair on’ mean?

Keep your hair on – can you lose your hair if you get too angry or excited? That’s what this idiom suggests. For example: “Keep your hair on – I only accidentally deleted your dissertation.”