Anas bin Malik reported,

The Messenger of Allah ﷺ swore an oath to abstain from his wives for a month. His foot had been sprained, so he stayed in an upper chamber of his.Umar came and asked, "Have you divorced your wives?"He replied, "No, but I have sworn to abstain from them for a month."He remained there for twenty-nine days, then came down and went in to his wives.

Bukhari 2469

Sahih

حدثنا ابن سلام حدثنا الفزاري عن حميد الطويل

عن أنس رضي الله عنه قال

آلى رسول الله ﷺ من نسائه شهرا وكانت انفكت قدمه فجلس في علية له فجاء عمر فقال أطلقت نساءك قال لا ولكني آليت منهن شهرا فمكث تسعا وعشرين ثم نزل فدخل على نسائه

البخاري 2469صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Injustices
Chapter
Upper rooms and elevated chambers, whether overlooking or not, on rooftops and elsewhere
Numbering
Darussalam 2469
Bukhari 2469