flashback
The recalling of past events involuntarily. Could stem from outer or inner stimuli; eg: a loud sound, a familiar smell for the former. Thinking about someone could be the latter. If the recollection is voluntary, use remembering.
Frequently associated with PTSD, and heightened under situations of emotional distress.