The important thing is that you pushed through it! That's fantastic!
Are you taking lessons? It seems like it would be good to have someone assisting you when this sort of thing happens, and it would also be really good to have eyes on the ground to help you correct little things so you can continue to improve. I'd also like to suggest a helmet to keep that head well protected!
I don't think I ever got so nervous I couldn't get on, but there were definitely times when my heart would race, especially when I rode my very nervous mare. Even now, riding my very steady appy gelding, my heart might accelerate a little sometimes, like today, when we rode by the barn and an icicle crashed down near us, and he decided to spook a little. The good thing is that his spooks are easy to ride - nothing like my mare's explosions. But I have a bit of PTSD from her bad spooks (she gave me a concussion - lucky I was wearing a helmet that day!) so even when I know I'm fine, sometimes my body still reacts. The only thing to do is to keep riding. Eventually it goes away.