The cocked hat, especially that of the eighteenth and early nineteenth centuries, was permanently out of shape, with the brim turned up along three sides, giving the hat the outline of a triangle.
The style was generally affected by officers of both the American and British armies during the Revolutionary War.
Undoubtedly the hat was ridiculed by the soldiery, because, in its distorted shape, so much of the hat brim was wholly useless.
Hence, in camp lingo, to knock a fellow soldier into a cocked hat meant that he would be knocked out of shape and rendered useless, and that is still the meaning that we attach to the expression and the meaning in which it first appeared in print, in 1833, when, in depicting American life in his period, it was used by James Kirke Paulding in Banks of the Ohio.
Some have credited the expression to a bowling game played in the United States about the middle of the nineteenth century.
In this game, only the three corner pins were set up, and the player was allowed three balls to a frame. The name given to the game was “cocked hat,” probably in allusion to the triangular arrangement of the pins.
But the oldest record of the game is in 1858, so it is unlikely that our phrase was in any way the outcome of this short lived game.