Confession does indeed forgive all sins. However if someone deliberately
withholds a mortal sin from confession it is not forgiven. If you've forgotten a mortal sin then you are "conditionally" forgiven for it, you only need to confess it next time you go to confession but you are not consider to be in a state of mortal sin. As the Catechism notes:
1456 When Christ's faithful strive to confess all the sins that they can remember, they undoubtedly place all of them before the divine mercy for pardon. But those who fail to do so and knowingly withhold some, place nothing before the divine goodness for remission through the mediation of the priest...
A person who has genuinely forgotten a mortal sin need not worry because s/he is not considered in a state of mortal sin. However the mortal sin does need to be confessed at the next reasonable opportunity.
The analogy I like to use is court. If you've reached a plea deal with the prosecution to avoid jail time you'll be asked to confess your crime to the judge. If the judge does not believe you are being honest s/he can void the plea deal and sentence you to prison. If you accidentally leave out a detail the judge will remind you of it, you'll then confess it and receive your plea deal.