Language:
كتاب الاعتكاف
33  
Retiring to a Mosque for Remembrance of Allah (I'tikaf)
(18)
Chapter: Whoever intended I'tikaf and then changed his mind
(18)
باب مَنْ أَرَادَ أَنْ يَعْتَكِفَ ثُمَّ بَدَا لَهُ أَنْ يَخْرُجَ
Sahih al-Bukhari 2045

Narrated `Amra bint `Abdur-Rahman from `Aisha:

Allah's Messenger (ﷺ) mentioned that he would practice I`tikaf in the last ten days of Ramadan. `Aisha asked his permission to perform I`tikaf and he permitted her. Hafsa asked `Aisha to take his permission for her, and she did so. When Zainab bint Jahsh saw that, she ordered a tent to be pitched for her and it was pitched for her. Allah's Messenger (ﷺ) used to proceed to his tent after the prayer. So, he saw the tents ans asked, "What is this?" He was told that those were the tents of Aisha, Hafsa, and Zainab. Allah's Apostle said, "Is it righteousness which they intended by doing so? I am not going to perform I`tikaf." So he returned home. When the fasting month was over, he performed Itikar for ten days in the month of Shawwal.

حَدَّثَنَا مُحَمَّدُ بْنُ مُقَاتِلٍ أَبُو الْحَسَنِ، أَخْبَرَنَا عَبْدُ اللَّهِ، أَخْبَرَنَا الأَوْزَاعِيُّ، قَالَ حَدَّثَنِي يَحْيَى بْنُ سَعِيدٍ، قَالَ حَدَّثَتْنِي عَمْرَةُ بِنْتُ عَبْدِ الرَّحْمَنِ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم ذَكَرَ أَنْ يَعْتَكِفَ الْعَشْرَ الأَوَاخِرَ مِنْ رَمَضَانَ، فَاسْتَأْذَنَتْهُ عَائِشَةُ فَأَذِنَ لَهَا، وَسَأَلَتْ حَفْصَةُ عَائِشَةَ أَنْ تَسْتَأْذِنَ لَهَا فَفَعَلَتْ فَلَمَّا رَأَتْ ذَلِكَ زَيْنَبُ ابْنَةُ جَحْشٍ أَمَرَتْ بِبِنَاءٍ فَبُنِيَ لَهَا قَالَتْ وَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِذَا صَلَّى انْصَرَفَ إِلَى بِنَائِهِ فَبَصُرَ بِالأَبْنِيَةِ فَقَالَ ‏"‏ مَا هَذَا ‏"‏‏.‏ قَالُوا بِنَاءُ عَائِشَةَ وَحَفْصَةَ وَزَيْنَبَ‏.‏ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ آلْبِرَّ أَرَدْنَ بِهَذَا مَا أَنَا بِمُعْتَكِفٍ ‏"‏‏.‏ فَرَجَعَ، فَلَمَّا أَفْطَرَ اعْتَكَفَ عَشْرًا مِنْ شَوَّالٍ‏.‏
Reference : Sahih al-Bukhari 2045
In-book reference : Book 33, Hadith 20
USC-MSA web (English) reference : Vol. 3, Book 33, Hadith 261
  (deprecated numbering scheme)