There are two different types of memory, declarative (implicit) and procedural (explicit) [1]. Within declarative memory there are two sub categories, semantic and episodic. Semantic memory consists of facts that are independent of context (for example 2 + 2 = 4) and episodic memory deals with information related to a certain context like time or place (for example what cake you had on your 16th birthday). Procedural memory deals with things along the lines of motor learning (for example learning how to walk).
These systems are different from each other and when someone has amnesia from a head trauma they will generally only lose one of the types of memory. The case you are referring to would mean that they lost their episodic memory. Since the systems are separate and only one was damaged it is possible for someone to not know their name but to remember how to talk and know what the capital of California is. It is also possible to lose your semantic memory while keeping your episodic memory intact. This would result in losing the ability to recall facts and even simple words but still being able to recall who you are and different events from your life [2].