I was with the Prophet ﷺ in a cave when his finger began to bleed. The Prophet ﷺ said, "You are nothing but a finger that has bled, and what you have suffered is in the path of Allah."He said, Jibreel was delayed in coming to him, so the polytheists said, "Muhammad has been forsaken." Then Allah Almighty revealed, "Your Lord has not forsaken you, nor is He displeased" [Duha 93:3].
حدثنا ابن أبي عمر حدثنا سفيان بن عيينة عن الأسود بن قيس
كنت مع النبي ﷺ في غار فدميت أصبعه فقال النبي ﷺ هل أنت إلا إصبع دميت وفي سبيل الله ما لقيت قال وأبطأ عليه جبريل عليه السلام فقال المشركون قد ودع محمد فأنزل الله تعالى {ما ودعك ربك وما قلى}
Muslim also narrated it in jihad, chapter on what the Prophet ﷺ suffered of harm from the polytheists and hypocrites, no. 1796, 1797, from the hadith of Sufyan bin Uyayna through this route. Shubah followed him in narrating it (Bukhari, no. 4951, and Muslim), as did Sufyan Thawri (Bukhari, no. 1124, 1125, 4983, and Muslim).