Upon the delivery of the undertaking to the magistrate the action before him shall be discontinued and each party shall pay his own costs. The costs so paid by either party shall be allowed to him if he recover costs in the action to be brought for the same cause in the circuit court. If no such action be brought within thirty days after the delivery of the undertaking the defendant's costs before the magistrate may be recovered of the plaintiff.
S.C. Code § 22-3-1130