TOS s2e3 “The Changeling”
He said the thing! Of course, Nomad is able to revive Scotty minutes later. What’s fucked up is that it also erased Uhura’s mind, but couldn’t restore her memories. The solution? Oh, we’ll just re-teach her everything. She won’t remember a damn thing about her former self or even possibly have the same personality, but hey, she can still do the job! And as with all TV magic, by the next episode it’s like it never even happened.
In TNG they would have done some kind of transporter fuckery to restore the state of her brain’s molecules to the last time she transported somewhere, or something like that. Too bad TOS transporter chiefs weren’t as talented as our Miles!
I’ve recently been following my own fan canon that Scotty is O’Brien. He found some ensign schmuck (O’Brien), buffered, records erased, removed his memory engrams, copied his memories into the template, set a timed release from a discreet transport unit, Bob’s your uncle, and a new chief engineer emerges.
The Scotty recovered in TNG is just a stray copy. Miracle worker indeed.
Wait till you discover who he manages to make himself become in the Delta quadrant also… :-P
Tos 1e5 the enemy within.