Unfortunately, now is a bit too late to tell the truth that your friend hid stuff in your bag, unless you can convince said friend to incriminate herself to clear you and even then it might be tricky.
You should definitely get a lawyer. If you can't afford one, plead not guilty and ask for a public defender. Your lawyer can help you get into any diversion programs that may be available, but it would be best if you got acquitted; you didn't actually steal anything, so your only crime was some ill-advised loyalty to this friend.
Unfortunately, unless said friend is just as loyal and offers the testimony you need, you'll end up paying a few thousand dollars in fines, court fees, legal fees, and civil demands, just so your friend might get charged with something less than the crime she committed.

