You can leave anytime you want as Canada do not have exit control during depature. You need ticket and your boarding pass.
But Yes, you need to be in Canada for restoration application. If you get LOA back to school again and as long as they did not cancel your SP, then you can make a case to have your SP, but you need confirmation of readmission/LOA from University. The only consequency with this route is you wont be eligible for pgwp. However if all go well with your restoration and SP and provided you want to pursue your Masters after undergrad then you will be eligible after graduating your Masters degree. But you will have tight window from when you finish undergrad and apply for Masters. By that time, your SP will not give you more time to go through application process for Masters, you will need to apply for change of status if you intend to continue be in Canada
however all of the above will be meaningless if they cancelled your permit and mark you as “Inadmissible”. You need to work with lawyer. This is where my comment on 3yrs wasted is... finally you can have login credential, student ID but that doesnt make you a student in Immigration perspective