"Yes the thought of retirement crossed my mind. I was so disappointed and upset at being dropped for the one-day series," Younis said.
"But my family and my friends told me you must not give in and try to do something for the country," he said on Geo Super channel.
The senior batsman, who left an undeniable mark in Pakistan's 2-0 victory over Australia in the Test series which concluded today, said his anger stemmed from the fact that he was sidelined by selectors after just one match.
Younis said he was hurt when selectors talked about him not featuring in their World Cup plans. "It hurts because if a player like me is not part of the future plans then what can other players say."
More From This Section
Younis said the incident was now a thing of the past and he has moved on.
He dismissed comparisons between his batting averages in Test and one-day cricket which is around 53 and 31.
"Yes playing in the World Cup is a big dream for me and I want to play a similar role that Javed or Inzamam played the last time we won the '92 World Cup," he said.
Younis also praised batting coach Grant Flower in his success as a batsman.
"It would be unfair not to mention the contribution of Grant Flower in this series win and our batting performances. Grant played a huge role in helping all the batsman play the way they did against Australia."
"I thank him for the support and help he gave me. It would be unfair not to mention his name while appreciating everyone's contribution."
Younis also spoke about the role of Misbah-ul-Haq in the team and series.
"Misbah this time was a changed person and he was coming to us for suggestions and it all worked well for us. In the end our onus was that if we failed as senior players we were answerable. But if we took a decision we must stick to it no matter what happened.