N.Y. Civil Practice Law & Rules § 7012
A person discharged upon the return of a writ of habeas corpus shall not be detained for the same cause, except by virtue of a subsequent lawful mandate.