WIth the inside on the outside .
This little phrase is as descriptive as the similar if much earlier phrase, 'upside down', in that it originally just meant 'with the inside on the outside'. That's how it was used in the earliest known citation, which is from the account of the life of the 16th century clown, Richard Tarlton, titled Tarlton's Jests, circa 1600. The citation is in the form on a stage direction for one of Tarlton's comic characters:
Could you turne him inside out,
You would presentlie see,
He is a more true begotten foole
Then ever I bee.
We now almost exclusively limit the use of 'inside out' to the extended phrase 'to know something inside out', i.e. to know in great detail, from all possible perspectives. This variant of 'inside out' is known in print from at least 1800; for example, this piece from The Dramatic Works of Baron Kotzebue, which was translated from the original German and published in New York in 1800:
"We have been in so many holes and corners together, that you know me both inside and out, as well as your own hammock."