I have experience in this area, but in Colorado. So this may be helpful, but check to make sure it would work in your state.
I believe what you are talking about is the civil demand. Stores are allowed this in order to try to recoup some of the costs associated with having security and surveillance measures and their costs. If no one shoplifted, they wouldn't have a need to pay for the expensive systems and loss prevention/asset protection personnel.
Anyway, it may be worth the time to make some phone calls. The store, unless it is a small or family owned place will probably not be any help. Find out if the store has a corporate office and/or legal department. Then get ahold of someone at one of those. Explain your situation, that you made a mistake, you regret it, and you want to do what you can to make things right, and avoid wasting everyone's time going to court if possible.
They may be willing to work with you if you are sincere about it. You sound like you feel bad about what happened, but make sure you stay polite and courteous with them, they hold the cards right now. Any attitude or rudeness will only hurt you.
Stores are sometimes willing to forget the civil demand, if restitution is made somehow, as it is a pain in the a** for their detectives and managers to go to court, and the store has to pay them for going when they could be paying them to be working instead.
Basically you will probably end up paying for the merchandise you stole, but may get out of paying for the civil demand and the asscoiated court costs.
If you do go to court, you will likely be assesed for all of it, the $ of merchandise, the $ of civil demand and the court costs.
Take the time to make some calls and see if they are willing to work with you, it may be well worth the time and effort. Good luck and keep out of trouble.