I thought this last year - I didn't work all year and started revising with 2 weeks to the exams. I thought i'd fail all my modules and have to retake the year, but somehow my cramming allowed me to average 60% across the exams (with a bit of help from throughout-the-year coursework). I ended up with a deferred pass in a module that I got ~38% in.
Moral is, don't give up until it's over. Lucky for me our first year exams don't count towards our degree, we just have to pass.
In terms of retaking, it varies from university to university, you'll probably have to talk to your course board and give a decent case for them to allow you to retake, other than that, if you only fail a few modules you will probably have to resit them during 2nd year.