I agree with the other posters - it's difficult to speculate about what the problem was without knowing more. But adding power and going around was definitely the right thing to do, so congrats on handling it well
Out of interest, what type of aircraft was this? What was the wind doing? What airfield were you at - grass or hard runway? And am I right in assuming that you're a solo student? Have you discussed this with your instructor?
FFF
--------------