Option 2 is correct, i.e. Habeas Corpus. There are five types of writs in the Indian Constitution –
Habeas Corpus.
Certiorari.
Quo-Warranto.
Mandamus.
Prohibition.
Habeas Corpus : The writ is issued to produce a person who has been detained whether in prison or in private custody, before a court and to release him if such detention is found illegal.
Mandamus : This writ of command is issued by supreme or high court when any government, court, corporation or any public authority has to do a public duty but fails to do so.
Prohibition : This writ is often issued by a superior court to the lower court directing it not to proceed with a case that does not fall under its jurisdiction.
Certiorari : The writ of certiorari can be issued by the supreme or high court for quashing the order already passed by an inferior court, tribunal or quasi-judicial authority.
Quo-Warranto : The writ of quo-warranto can be issued by the supreme or high court for asking of by what authority or warrant. It is issued by the court to enquire into the legality of a claim of a person to a public office.