As per Mahabharata: Karna Parva, Yudhishthira wanted to retire into forest leaving Mahabharata war after Arjuna insulted him:
Hearing, however, those harsh words of his brother Phalguna, Pandu's son, king Yudhishthira, the just, rising up from that bed (on which he had been sitting), said these words unto Partha, with his heart filled with sorrow, "O Partha, I have acted wickedly. For that, ye have been overwhelmed with terrible calamity. Do thou strike off, therefore, this my head today. I am the worst of men, and the exterminator of my race. I am a wretch. I am addicted to wicked courses. I am of foolish understanding. I am idle and a coward. I am an insulter of the old. I am cruel. What wouldst thou gain by always being obedient to a cruel person like me? A wretch that I am, I shall this very day retire into the woods. Live you happily without me. The high-souled Bhimasena is fit to be king. A eunuch that I am, what shall I do with sovereignty? I am incapable of bearing these harsh speeches of thee excited with wrath. Let Bhima become king. Having been insulted thus, O hero, what use have I with life." Having said these words, the king, leaving that bed, suddenly stood up and desired to go to the woods.
Krishna explained that Arjuna did that due to his vow:
Then Vasudeva, bowing down, said unto him, "O king, the celebrated vow of the wielder of Gandiva who is ever devoted to truth about his Gandiva, is known to thee. That man in the world who would tell him, 'Give thy Gandiva to another', would be slain by him. Even those very words were addressed to him by you. Therefore, for keeping that earnest vow, Partha, acting also at my instance, inflicted you this insult, O lord of Earth. Insult to superiors is said to be their death. For this reason, O thou of mighty arms, it behoveth thee to forgive me that beseech and bow to thee this transgression, O king, of both myself and Arjuna, committed for maintaining the truth. Both of us, O great king, throw ourselves on thy mercy. The Earth shall today drink the blood of the wretched son of Radha. I swear truly to thee. Know the Suta's son as slain today. He, whose slaughter thou desirest, hath today lost his life."
After Krishna's words:
Hearing those words of Krishna, king Yudhishthira the just, in a great fury, raised the prostrate Hrishikesha and joining his hands, said in haste, "It is even so as thou hast said. I have been guilty of a transgression, I have now been awakened by thee, O Govinda. I am saved by thee, O Madhava. By thee, O Acyuta, we have today been rescued from a great calamity. Both of us stupefied by folly, viz., myself and Arjuna, have been rescued from an ocean of distress, having obtained thee as our lord. Indeed, having obtained the raft of thy intelligence today, we have, with our relatives and allies, passed over an ocean of sorrow and grief. Having obtained thee, O Acyuta, we are not masterless."'"
Apart from this, one more instance is described in Meaning of Krishna's advice to Yudhisthira before Drona Vadh post.