Amnesia is a medical condition which results in the loss of memory. It comes in two general forms, anterograde amnesia where new memories are not transferred to long term memory and retrograde amnesia which is the loss of past memories.
Starfleet Commander Jay Allan was diagnosed with retrograde amnesia due to irreparable brain damage suffered during an away mission in late 2373. Rather than undergo retraining, he was granted a medical discharge. (Kal-Dixas Spaceport)