Pervez Musharraf, the former military dictator of Pakistan, has revealed that he contemplated the option of using nuclear weapons against India in the year 2002.
It was the time when tensions between the two countries were on a high after the terrorist attack on Indian Parliament on December 13, 2001.

General Pervez Musharraf. Financial Express/ The Indian Express
India had accused Pakistani military intelligence agency of assisting a radical Islamist group in plotting and carrying out the attack. A stand-off between the Indian and the Pakistani army continued until October 2002 and a huge force was deployed by both the countries along their respective borders.

A Pakistani nuke. Daily Pakistan
According to an interview of Pervez Musharraf published by Mainichi Shimbun, a Japanese daily, the former president spent many nights sleeplessly, asking himself whether he should use nukes against India.
Musharraf also, according to the report, finally decided against using nuclear bombs for the fear of retaliation.
At that time, Musharraf had publicly admitted that he will not rule out the possibility of using nukes and his acceptance to it now very well proves that his saying it even at that time was a reality and not a diplomatic move.
A few excerpts from the report by ‘Mainichi Shimbun’ read as follows:
Musharraf told the Mainichi that when tensions were high in 2002, there was a “danger when (the) nuclear threshold could have been crossed.”
Musharraf also said, however, that at the time, neither India nor Pakistan had nuclear warheads on their missiles, so it would have taken one to two days to make them launch-ready. Asked whether he had ordered that missiles be equipped with nuclear warheads and put into firing position, he said, “We didn’t do that and we don’t think India also did that, thank God” — pointing, perhaps, to a fear of retaliation that applied psychological brakes on both sides. The two countries subsequently avoided an all-out clash and tensions subsided.
Eventually, both the countries averted nuclear attack and hence the devastating consequences.