Retreat in embarrassment. Commonly thought of as a dog being kicked and runs away hiding it’s tail between it’s leg. Any situation where one has been strongly defeated.
“That mean kid at school was always hitting me, but one day the teacher walked in and saw him, so he left the room with his tail between his legs.”