Any person in actual confinement for debt or damages in any jail in this state may give bond for the prison limits as provided by section 2A:21-2 of this title, and thereupon be discharged from imprisonment, except within such limits, notwithstanding any former verdict or judgment rendered against him in any action for his discharge under chapter 20 of this title (s. 2A:20-1 et seq.).
N.J.S. § 2A:21-5