Like Without Wings said, efficient work is probably the best way to overcome this stressful period. At times like this, it is good to start things all over again, even though it may be difficult. Writing down all your subjects on paper and then jotting down a few major areas that you need to improve on/cover will give you a simple guide so that you will be able to see what you need to do.
Possibly the best thing to do would probably be to purchase/borrow some study guides (if you havn't so already) or use HSC ONLINE and highlight the major points and then make simple dot point notes for your topics that you believe you should have covered already. Ask your teacher for some advice individually.
Simple yet productive work will definitely get you back on track and to stay positive. I guess in a way it's similar to counting numbers with your fingers for maths IN THE HSC EXAM, but really it doesn't matter just as long as you get the correct outcome in the end. It's simple yet productive.
A study lady came into my school and told us (from her experience and from the experiences of other students' that she's seen) that it's never too late to prepare purely for the HSC exams unless it's about a week or 2 before. But in this case, you have 10 weeks or so until your trial exams (well for my school atleast), and added to that is about 14 or so weeks until the HSC. That's a huge amount of time to get back on track.
Personally, if I'm in a negative situation, I picture myself sitting my last HSC exam (Studies of religion 2unit), and putting my pen down and then immediately reflecting back throughout the year...and I ask myself, did I do enough or could I have done more?
I also imagine/picture my position a few weeks ahead from the present; I'm either:
1) Stressing out bad and whining OR
2) I'm dedicated and determined with my head down
If you believe you can do it, put your head down and you will gradually come back on path and soon enough, eventhough the progress will be hard, you will be well-prepared for the trials and HSC exams. And on the day when you get your UAI, you can think back and declare to your self re-assuringly, "I believe I deserve that UAI!"
Good luck.