I think this was an Outer Limits or Twilight Zone episode. I remember watching this in the early 2010s, but I think the episode was a repeat of an earlier series, possibly from the 1960s.
In the episode, a man visits a small town to investigate unusual activity. While there he becomes suspicious of the activity of the townspeople.
He hooks up with a woman, and they discover an alien spaceship in the desert.
The spaceship chases the couple, and eventually they take shelter in the town, where they have to hide from the townspeople who are aliens in disguise.
Eventually they are captured and taken to the spaceship. The man is put into a machine, and his memories are restored. Turns out he was an alien all along, but had forgotten (not sure if that was deliberate).
Can someone help me identify this episode?