tail between one's legs, with one's

Dejected, cowed, ashamed, especially after a defeat or being proven wrong. For example, After bragging about her great musical ability, she lost the competition and went off with her tail between her legs. This idiom alludes to a dog's slinking away in this manner. [First half of 1800s]

The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.