It is narrated that one of the first things that happens in the barzakh (the next realm after this life) is that a human being is forced to transcribe their entire life.
Also with respect to the hereafter it is said that all deeds will be clearly visible and known, and that all things are recorded (except for what Allah wills to hide or forgive).
So, basically, there is a complete memory there, including of things we have forgotten during our lives in this world.