Don’t Get Your Knickers in a Twist

What does the idiom “don’t get your knickers in a twist” mean?

Definition: calm down, don’t get upset

Example: I know there’s been an accident in the Underground. Don’t get your knickers in a twist—we’ll just call a taxi.

Note: This is British. The American equivalent is “don’t get your panties in a bunch.”