This page has been brought up to standards by an Admin/Bureaucrat, and now checks out. Please try not to mess it up.
Aftertale is an AU where Sans remembers the resets.
Aftertale's backstory is where Chara has full control of Frisk's body and keeps resetting the timeline and doing the genocide route for what Chara calls "research". After thousands of resets, Sans feels as if the only way to beat Chara is through injecting determination in himself just before Chara reaches the Judgement Hall.
After 536 tries, Chara was finally was able to hit Sans. As he was dying, Sans walks off and notices he had the ability to CONTINUE, RESET and SAVE. Sans had also the ability to teleport to the save screen where he reset his timeline.
Sans (now nicknamed Geno because of the Genocide route) cannot leave the save screen or he will turn to dust. Chara then gains so much determination that Frisk permanently loses control of their body and joins Geno in the save screen.