This affected all the characters except Flowey, Chara, Frisk and Sans.
Frisk, Chara and Flowey have determination enabling them to keep their memories. Sans is aware of the resets so was able to keep his memories.
Flowey begins to get bored with this new timeline in which nobody remembers anything so he agrees to help Sans, who is desperately looking for a way to restore his brother's memories. But is Flowey really on his side?