The best thing you can do, is evaluate what happened and to try and think of what can be done differently to mitigate those conditions from becoming a problem.
I've had one or two busters in the time I've been riding. Nothing more than a graze though. Once was doing a U-turn on a slippery road after rain, another was me not paying attention and mounting the gutter. A third was me braking heavily to avoid rear-ending a council bus.
Since then I've gotten better, learned how to brake more effectively.
Last few times I've come anywhere near a crash, it was a few weeks back I went over some gravel on the road, and I could feel the front wheel about to slide out from underneath me. A minor correction and I managed to keep the bike upright and kept going — no crash.
Another was one pillock of a woman decided to execute a U-turn right in front of me. I could feel my rear wheel sliding that morning, but even then, I stayed upright.
So yes, in your first year or so you will have a few busters, although yours sound more severe than mine ever were. A bit more care and attention though, and you'll improve.