mutatis mutandis

Oh my! I have heard this phrase before but never looked it up. It sounds to me like - well - it's because I know Italian... "mutatis" I rightly guessed to mean "change", but in Italian, "mutande" is underpants!!!!! So whenever I saw this I thought "changing underpants?????? why on earth would you make a Latin phrase for this?" (Of course I guessed there must have been another meaning but I can't get the "changing underpants" thing out of my head!)