I'll eat my hat
A display of confidence in a particular outcome; for example, 'She's always late. If she gets that train I'll eat my hat'.
Eating one's hat is, of course, something we wouldn't want to attempt in reality and the phrase is only used when the speaker is quite certain of the outcome of some event. The earliest example of the phrase that I can find in print is Thomas Brydges' Homer Travestie (A Burlesque Translation of Homer), 1797:
For though we tumble down the wall,
And fire their rotten boats and all,
I'll eat my hat, if Jove don't drop us,
Or play some queer rogue's trick to stop us.
Charles Dickens used an extended version of the expression in The Pickwick Papers, 1837:
"If I knew as little of life as that, I'd eat my hat and swallow the buckle whole."
The OED also gives an earlier form - "I'll eat Old Rowley's hat". This is never used now, and the lack of references to it in print seem to indicate that it never was commonplace.
Old Rowley was the name of a favourite horse of Charles II, and the name later transferred to Charles himself. The source of the mocking nickname appears to be the king's reputation with the ladies. This piece was printed in The Biographical History of England, 1775:
In some of the State Poems, Charles II, is ridiculed under the nick-name of Old Rowley, which was an ill-favoured stallion kept in the Mews, that was remarkable for getting fine colts - Mrs. Holford, a young lady much admired by Charles was sitting in her apartment, and singing a satirical ballad upon "Old Rowley the King," when he knocked at her door. Upon her asking who was there? he with his usual good humour replied, "Old Rowley himself, madam."
It isn't entirely clear why Charles' hat should have been singled out for consumption, although it's possibly an allusion to the large, florid headgear favoured by the king and his courtiers, which would have been especially difficult to eat.
An alternative derivation has been put forward. This maintains that 'hattes' were medieval veal pies and hence the phrase derives from them. There is some evidence that 'hattes' were a form of pie. The online 'Boke of Gode Cookery', presents a version of a recipe for Hattes, which it says are "small meat-filled pastries that resemble medieval hats". It cites the book 'An Ordinance of Pottage' as the source. Despite sounding authentically medieval, both these publications are recent. Constance Hieatt's An Ordinance of Pottage was published in 1988, being based on 15th century recipes taken from Yale University's MS Beinecke Library. That's a rather tenuous set of Chinese whispers and I've not had sight of the original scripts, so can't confirm that the hattes recipe given on the Boke of Gode Cookery site is accurate.
The 'hence' part of this argument is spurious. Pies can be eaten, certainly, but these 'hatte' pies were a 15th century creation and the word was never in sufficient circulation for it to have been recorded in the OED, which claims, with good reason, to be 'the definitive record of the English language'. Nor does 'eat my hat' appear in print until 200 years after the last person ate a hatte. Also, 'eat my hat' has always meant 'submit myself to something unpleasant if I prove to be wrong'. Eating veal pies is far from unpleasant, and so the supposed derivation doesn't match the meaning. Nevertheless, it's a nice story and one that many people would like to be true, despite any documentary evidence to support it.
See also: eat humble pie.