Let the cat out of the bag

: I actually understood the origins of this to be from the British
Navy in the 18th and 19th centuries. On warships, punishment was
often meted out by flogging men with a cat 'o nine tails. The said
whip was kept in a red velvet bag, and when the 'cat' was out of
the bag, you knew the game was up for someone.

: Anyone else heard this explanation?

Yes. That one theory. To read others, search the discussion archives
under "bag." Here's one explanation posted by Mr. Briggs:

To let the cat out of the bag is said to occur if a secret is revealed.
This type of cat is truly furry, unlike that just described. In
medieval times piglets were often taken to market in a sack where
they were sold. If the purchaser was particularly gullible he was
sometimes sold not a piglet, but a cat in the sack. Cats are versatile
animals and sometimes managed to escape - the cat was truly out
of the bag. In similar manner it was possible to be sold a pup.
Incidentally, the sack or bag was correctly termed a poke, hence
a pig in a poke. To be sold a pig in a poke was clearly the object
of the exercise and why it has come to imply a swindle I can't understand.
However, there are other sayings and words which have reversed their
meanings over the years. Why this should be so is not understood
but this drift of meaning is known as catachresis. A good example
of drift is found in the word Brave. In the past it implied cowardice
as, indeed, Bravado still does. Incidentally, the diminutive of
poke lives on today in modern English in the form of Pocket.