It seems as though you may have overeverted yourself and ended up pulling a muscle. When you go into bow pose in the future, consider using a strap if you're not prepared to reach for your feet. Yoga is about listening to your body and not moving beyond that perfect point between effort and ease.
I suppose the short answer is - don't lie on your belly and pull your legs over your head unles you want to have ribcage pain for four days.
Your question actually begs more questions.
What is your level of practice? How long and in what style? Who is your teacher? Have you discussed this with your teacher? How did she/he respond? Was this part of a larger sequence of poses? Did you properly warm up? What is your age and health condition?
All of thee things are quite important to tailor a response to the individual. And in Yoga there are very few "group answers".
NOTICE: The information provided on this site is not a substitute for professional medical advice,
diagnosis, or treatment. Never delay or disregard seeking professional medical advice from your
physician or other qualified health provider because of something you have read on Wellsphere.
If you have a medical emergency, call your doctor or 911 immediately.