With the inner surface turned out or revealed, as in He wore his shirt inside out. This expression dates from about 1600 and was soon used figuratively, as in He turned the verses inside out and revealed their hidden sense.
Extremely well, thoroughly, especially alluding to knowing something. For example, He knows this system inside out. [First half of 1900s]