What does 'you really put your foot in it' mean?

An expression sometimes found in British novels, especially in the late 19th, early 20th century and perhaps later. Generally, it means the speaker has either embarrassed himself or placed himself in a dangerous or potentially embarrassing situation by some action, often an agreement, done without giving forethought. "Back in London when I signed on for this trek? I really put my foot in it that time." It's implied that the speaker has 'stepped' into something 'nasty,' such as manure, which is now 'stuck' to him so that he cannot easily extricate himself.

"Many times afterwards the Baggins part regretted what he did now, and he said to himself: "Bilbo, you were a fool; you walked right up and put your foot in it."

J.R.R.Tolkien, The Hobbit, pg 16.

In African-American communities the expression "put your foot in it" has a different, positive meaning: it's a compliment to a cook, meaning a meal or dish is exceptionally well prepared. "Boy, you really put your foot in it." It can also be a self-compliment: "Boy, I really put my foot in it."