To restrain yourself, become less belligerent, retreat, calm down, chill out, cool off , lower your ambitions, cut back on spending
This phrase has nothing to do with the large mammals we think of as having horns, such as domestic bulls, or moose, or goats. None of these animals can retract their horns. What it does refer to is the ordinary garden snail.
The snail’s eyes are on retractable tentacles, called ‘horns,’ and the snail can pull them into its shell if it’s threatened. Other animals also have hornlike protuberances on their heads, such as some insects, and tufts of feathers on the heads of some owls.
Snails were spoken of as ‘pulling their horns in’ as early as the 14th century. An example of that is found in an extract from the Anglo-Norman romantic poem, Richard, Coer De Lyon.
Another appears in the 16th century religious diatribe Hay any Work for Cooper, 1589. ‘Coopering’ means making or repairing barrels or casks.
Gardeners will be familiar with the behavior of snails. Not me, though. These days my gardening is limited to buying a bouquet of flowers at the grocery store now and then.