He told me he doesn't want to date me anymore that its over so why is my mind constantly thinking maybe he will change his mind? How can I stop?

I have to remind myself what he said that it won't work out because he has "too many flaws" and that we don't match because im sort of dependent on situations where I always need help on or advice and he feels overwhelmed with me he says. He said hi to me today but I felt hurt and my emotions took over me where I felt hate towards him because he hurt me (things he would do on purpose) I wasn't really talking to him mainly avoiding him to not show emotion but when he said "I did nothing wrong why you being rude?" It hit me and I felt my eyes watery and I just wanted to be left alone. Until he excused himself and I cried but without him seeing. Later I felt bad and texted him sorry but he didn't seem to really care. Then I thought why does it even matter? He isn't even interested in me. If he was he wouldn't let me go and see someone else
Updates
+1 y
Its almost like my heart tries to give me hope but my mind is telling me "no it will never work anymore". I get sad feelings that its over and remember fun times but then it was going really horrible towards end for usmainly how he was treating me. I hate this about me. I just never seem to learn and no matter how much someone hurts me I still want to fix it or make it work and I just keep hurting myself that way because I want it how it used to be
He told me he doesn't want to date me anymore that its over so why is my mind constantly thinking maybe he will change his mind? How can I stop?
Post Opinion