A person imprisoned in a common jail, or the liberties thereof, or otherwise restrained of his or her liberty by an officer or other person, may prosecute a writ of habeas corpus to inquire into the cause of such imprisonment or restraint, and obtain relief therefrom if it is unlawful.
12 V.S.A. § 3952