It means "you completely misunderstood the situation," "you are totally mistaken." You are so mistaken that you believe the exact opposite of what is true.
"Got" can mean "learned," "understood," "perceived."
"No, to die a square knot you first put right over left, then left over right." "Oh, thanks. I get it now."
"I learned today that a liter is just a little smaller than a quart." "You got it backwards. It's exactly the other way around: a quart is a little smaller than a liter."
"Tell me the cranial nerves." Olfactory, optic, oculomotor, trigeminal, trochlear--" "Stop, you got the 'T's backwards." "Oh, yes, of course. Trochlear, trigeminal, abducens...
It is a blunt statement. It's not a particular nice way to say it. Depending on the situation and tone of voice, it can be just a plain fact, "you made a mistake," or it can be somewhat harsh, "you made a stupid mistake."
"I think Barbara likes me." "Oh boy, you got that backwards, she can't stand you."