Paradoxical undressing is a term for a phenomenon frequently seen in cases of lethal hypothermia. Shortly before death, the person will remove all their clothes, as if they were burning up, when in fact they are freezing. Because of this, people who have frozen to death are often found naked and are misidentified as victims of a violent crime. 

Why does this happen? According to M.A. Rothschild and V. Schneider, writing in the International Journal of Legal Medicine:

The reason for this paradoxical behaviour seems to be the effect of a cold-induced paralysis of the nerves in the vessel walls, which leads to a vasodilatation, giving a feeling of warmth. Another theory proposes that the reflex vasoconstriction, which happens in the first stage of hypothermia leads to paralysis of the vasomotor center giving rise to the sensation that the body temperature is higher than it really is and in a paradox reaction the person undresses.
But wait! It gets even weirder. Once they’ve undressed, the dying person will frequently try to crawl into a small, enclosed space. For which reason, victims of hypothermia are often found naked, squeezed into cupboards or beneath beds. This is called Terminal Burrowing Behavior. Again from Rothschild and Schneider:

In 20% of our cases of death due to hypothermia the bodies were found in a position, which at first induced the suspicion of an attempt to hide the body. But after all our examinations together with the police investigations it was clear that no other person was involved. Obviously the strange positions in which the bodies had been found, were the result of a (pre-)terminal behaviour, which – for lack of comparable descriptions in the literature – we have called “terminal burrowing behaviour”. The discovery positions always gave the impression of a protective burrow-like or cave-like situation, as the bodies were found under the bed, behind the wardrobe, in a shelf etc.. The clothes of the bodies were always strewn on the ground in front of the final position, sometimes forming a trail. In every case the paradoxical undressing had obviously happened before this self-protective “burrowing behaviour”. This is sustained by the fact that the removed clothing was never found at the final position where the body was found, and some of the victims due to cooling had obviously been crawling around. In most cases the final position in which the bodies were found could only be reached by crawling on all fours or flat on the body, resulting in abrasions to the knees, elbows, etc. This crawling to the final position seems to have happened after undressing as there were abrasions to the skin but no damage to the corresponding parts of the removed clothing.