You could be convicted and go to jail, even if you start restitution, if charges are pressed or the authorities otherwise become aware of the crime: a person can be convicted for having committed a crime  even if he or she then provides restitution or otherwise undoes the harm done. That said, restitution will typically count heavily in your favor in the criminal proceeding; the prosecutor may decide to drop the charges, or agree to let you plead to lesser  charges, or the judge may impose a lesser sentence because you are providing restitution.