Transient global amnesia (TGA) is a neurological disorder whose key defining characteristic is a temporary but almost total disruption of short-term memory with a range of problems accessing older memories. A person in a state of TGA exhibits no other signs of impaired cognitive functioning but recalls only the last few moments of consciousness, as well as possibly a few deeply encoded facts of the individual's past, such as their childhood, family, or home perhaps.
It's usually fairly short lasting - typically 2 - 8 hours. It's known that various triggers can lead to TGA episodes - such as: vigorous exercise - trauma - migraine - intoxicants - epilepsy etc.
The underlying psycho-neural mechanisms which lead to an attack, and the way in which sufferers recover in a few hours, is unknown.