What did I just do

I masturbated after over a month of staying strong. I wasn’t lusting over someone or something. I was literally counting in my head to keep that from happening. But the devil got to me and I feel like my relationship with god was just degraded. I made a promise to God I said vows to God I’m engaged to God and I still defiled him like that. I definitely did not like the feeling so I’m not doing it again. But I feel like I need to recommit myself to God.