Unfortunately this is somewhat common, and it's definitely not your fault. Whether it's the guy or girl in the relationship, one of them often will end up panicking as the next stage gets closer and deciding that maybe they were thinking too narrowly about their future life and aren't so sure anymore. On top of that, emotions are fleeting. It's really hard to rely on the excitement of romance, because if there's not true commitment and something deeper under the surface, things can change unexpectedly. I know how much that can hurt. Talk to her more when the time is right, and make sure she wasn't just overreacting to something or making an unnecessarily rash decision.
Maybe the two of you will change your minds and unexpectedly reunite, but it's not something you can bank your hopes on. I ended up regretting the amount of time I spent in college hoping to reconcile with a girl and then hoping I would end up with another girl. I ended up getting really into film and photography, and I would encourage you to similarly pursue something you're passionate about in order to keep your mind off of this girl and better yourself in the meantime. What are you going to be studying? How can you pursue it with vigour, and look for opportunities to advance it outside of your classes? Hoping for the best, and that you will look to the bright future.