In 2268, James T. Kirk accidentally activated a memory beam by initiating an asteroid deflector beam out of sequence on Amerind. This caused him to lose his memory except for bits and pieces, which later returned to him in his dreams. He assumed the alias of Kirok and lived with a tribe of Native Americans that had been transplanted from Earth to Amerind by the Preservers centuries earlier.
Kirk eventually regained his memory with the help of Spock, who performed a mind meld on him. When Kirk told Spock how he had lost his memory, Spock concluded that it must have been a memory beam that caused it. (TOS: "The Paradise Syndrome")