Literally, it means to have one's pants pulled down and left in one's undies, or nothing at all.
Metaphorically, it means some sort of ignominious defeat.
its what kids are calling 'flagged' these days
it means your trousers are pulled down
when i was in school it was when someone ran up to a guy and yanked his pants to his ankles sometimes they was lucky enough to still have underwear on