Board Thread:Questions and Answers/@comment-29905311-20170130083321/@comment-27701762-20170130102145

That's Sans's line no matter what you've done leading up to the Genocide battle. You could do Genocide as your very first run and he would still give that line. It's not supposed to be an indication of him remembering a True Pacifist or even Neutral run. It's just him trying to find some way to appeal to the protagonist and get them to stop fighting and let their guard down.

Sans also thinks that one possibility is that the protagonist just wants to have friends, as is indicated by his lines once you reject his appeal. So his little speech is a way of appealing to what he thinks the protagonist might actually want.

But perhaps you're not satisfied with that reading. If not, I'll provide another:

If the intended way the game would be played was that players would perform a True Pacifist route and then (at some point) a Genocide run, then indeed at one point the protagonist (or more appropriately the player) would have befriended Sans. Sans in general doesn't actually remember stuff across the timelines, but is able to accurately guess what has happened based on the way the protagonist reacts to things. So Sans could simply be interpreting some action of the protagonist (or perhaps the player) as a sign of having been a friend in another timeline, and is basing his appeal off of that interpretation. It doesn't mean that Sans actually remembered the older True Pacifist runs. It just means that he is noticing something about how the protagonist (or, again, the player) acts.