(7) باب نَذْرِ الْكَافِرِ وَمَا يَفْعَلُ فِيهِ إِذَا أَسْلَمَ
lbn 'Umar reported:
When Allah's Apostle (ﷺ) came back from the Battle of Hunain, Umar asked Allah's Messenger (ﷺ) about the vow he had taken during the days of Ignorance that he would observe I'tikaf for a day. The rest of the hadith is the same.
Reference: Sahih Muslim 1656 d
In-book reference: Book 27, Hadith 43
USC-MSA web (English) reference(deprecated numbering scheme): Book 15, Hadith 4075