Language:
كتاب الأحكام
93  
Judgments (Ahkaam)
(47)
Chapter: Whoever gave the Bai'a and then cancelled it
(47)
باب مَنْ بَايَعَ ثُمَّ اسْتَقَالَ الْبَيْعَةَ
Sahih al-Bukhari 7211

Narrated Jabir bin `Abdullah:

A bedouin gave the Pledge of allegiance to Allah's Messenger (ﷺ) for Islam. Then the bedouin got fever at Medina, came to Allah's Messenger (ﷺ) and said, "O Allah's Messenger (ﷺ)! Cancel my Pledge," But Allah's Apostle refused. Then he came to him (again) and said, "O Allah's Messenger (ﷺ)! Cancel my Pledge." But the Prophet (ﷺ) refused Then he came to him (again) and said, "O Allah's Messenger (ﷺ)! Cancel my Pledge." But the Prophet (ﷺ) refused. The bedouin finally went out (of Medina) whereupon Allah's Messenger (ﷺ) said, "Medina is like a pair of bellows (furnace): It expels its impurities and brightens and clears its good.

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ يُوسُفَ، أَخْبَرَنَا مَالِكٌ، عَنْ مُحَمَّدِ بْنِ الْمُنْكَدِرِ، عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ،‏.‏ أَنَّ أَعْرَابِيًّا، بَايَعَ رَسُولَ اللَّهِ صلى الله عليه وسلم عَلَى الإِسْلاَمِ فَأَصَابَ الأَعْرَابِيَّ وَعْكٌ بِالْمَدِينَةِ، فَأَتَى الأَعْرَابِيُّ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ أَقِلْنِي بَيْعَتِي، فَأَبَى رَسُولُ اللَّهِ صلى الله عليه وسلم ثُمَّ جَاءَهُ فَقَالَ أَقِلْنِي بَيْعَتِي فَأَبَى، ثُمَّ جَاءَهُ فَقَالَ أَقِلْنِي بَيْعَتِي فَأَبَى فَخَرَجَ الأَعْرَابِيُّ، فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِنَّمَا الْمَدِينَةُ كَالْكِيرِ تَنْفِي خَبَثَهَا وَيَنْصَعُ طِيبُهَا ‏"‏‏.‏
Reference : Sahih al-Bukhari 7211
In-book reference : Book 93, Hadith 71
USC-MSA web (English) reference : Vol. 9, Book 89, Hadith 318
  (deprecated numbering scheme)