Janice Lester body transfer

A former lover takes Kirk's body

Dr. Janice Lester used an alien device to swap bodies with Kirk and took command of the Enterprise until her behavior and Spock's mind-meld exposed her.

In 2269 the Enterprise answered a call from an archaeological team on Camus II. Dr. Janice Lester, who had been involved with Kirk years before and resented that she could not command a starship, used an ancient device to transfer her mind into his body and leave him in hers. With the help of Dr. Arthur Coleman, she took command of the Enterprise.
Her erratic behavior and cruelty raised suspicions. Spock mind-melded with Lester's body, found Kirk inside and was charged with mutiny. During the hearing the transfer weakened and was reversed. These events were shown in Turnabout Intruder, the last episode of the original series to air.