First, I want to assure you that no, you didn't commit the unpardonable sin. How do I know that? Because if you did you wouldn't be concerned that you did. Your safe.
Second, since I've experienced similar thoughts in my younger days it may be helpful to bring attention to a condition known as scrupulosity, I'm by no means a professional and therefore won't make any assumptions about your state of mind, but it can be helpful to be informed. You can learn about what scrupulosity is
here. It is, technically, a form of OCD, which is why I won't say anything about you personally since I don't know you, your state of mind--but if this is a reoccurring issue, it can help to talk to a therapist. Speaking personally I was regularly inundated with thoughts of hopeless terror, each thought in my mind a risk, I felt, of my ultimate destruction and judgment--which led me to despair and trying to be as "spiritual" as possible so as to not invoke the ire of God.
Chances are that I suffered from a form of scrupulosity, but since I never actually spoke with anyone about it I can't be sure. What I do know is that I have had other mental issues, namely depression and anxiety disorders, that were only diagnosed as an adult in my mid-late 20's. Further, I was part of religious environments that put a great deal of emphasis on my need to be "spiritual" and to show "fruit" and to "grow in righteousness", and as such, in retrospect, I was receiving very little actual preaching of the Gospel. It was there, it's not like I didn't know the Gospel or never heard it, but it was often masked with preaching of the Law and would confuse the Gospel with the Law--as a result I regularly fell into despair and into a cycle of desperately trying to experience and "feel" God.
I cannot stress the importance of actually just hearing the Gospel itself, because it is the no strings attached love of God.
God loves you. God loves you so much that God became a man and offered His life for you. He loves you so much that He threw Himself away in love so that you, though you're a sinner, can be His child. And you are. You are His child. You are a child of God because Jesus makes you God's child. And there is no power on earth that can stop that from being true. You belong to God because Jesus says so, He said so by dying on a cross, and rising from the dead.
-CryptoLutheran