If you keep your head, you remain calm in a difficult situation. If you lose your head, you panic or do not remain calm in a difficult situation.
She was able to keep her head and not panic.
She lost her head and started screaming at me.
Synonyms: stay calm, stay cool, remain unruffled, keep your shirt on [informal]