Jabir bin Abdullah reported,

We were traveling with the Messenger of Allah ﷺ until we camped in a broad valley. The Messenger of Allah ﷺ went off to relieve himself, and I followed him with a small vessel of water. He looked around but saw nothing to screen himself with, until he noticed two trees at the edge of the valley. The Messenger of Allah ﷺ went over to one of them, took hold of one of its branches, and said, "Yield to me, by the permission of Allah."It yielded and came along with him like a camel led by its nose-ring, docile with the one leading it. Then he came to the other tree, took hold of one of its branches, and said, "Yield to me, by the permission of Allah."It too came along with him in the same way. When he stood midway between them, he brought the two together and said, "Join together over me, by the permission of Allah." And they joined together.Jabir said, "I ran off quickly, afraid that the Messenger of Allah ﷺ would sense that I was close by and move farther away." Muhammad bin Abbad's version says "and withdraw." Jabir continued, "So I sat talking to myself. Then I happened to glance around, and there was the Messenger of Allah ﷺ coming toward me, and the two trees had separated, each standing again on its own trunk. I saw the Messenger of Allah ﷺ pause for a moment and motion with his head like this." Abu Ismail gestured with his own head to the right and to the left.Then he came forward, and when he reached me he said, "Jabir, did you see where I was standing?"I said, "Yes, Messenger of Allah."He said, "Then go to the two trees and cut a branch from each of them. Bring them along, and when you reach the spot where I was standing, drop one branch on your right and one on your left."Jabir said, "So I got up, took a stone and broke it and chipped it until it had a sharp edge for me. Then I went to the two trees and cut a branch from each, and came dragging them along until I stood where the Messenger of Allah ﷺ had stood. I dropped one branch on my right and one on my left. Then I caught up with him and said, 'I have done it, Messenger of Allah. What was it for?'"He said, "I passed by two graves whose occupants were being punished, and I wanted, through my intercession, that their suffering be eased for as long as the two branches remain fresh."

Muslim 7518

Sahih

سرنا مع رسول الله ﷺ حتى نزلنا واديا أفيح فذهب رسول الله ﷺ يقضي حاجته فاتبعته بإداوة من ماء فنظر رسول الله ﷺ فلم ير شيئا يستتر به فإذا شجرتان بشاطئ الوادي فانطلق رسول الله ﷺ إلى إحداهما فأخذ بغصن من أغصانها فقال انقادي علي بإذن الله فانقادت معه كالبعير المخشوش الذي يصانع قائده حتى أتى الشجرة الأخرى فأخذ بغصن من أغصانها فقال انقادي علي بإذن الله فانقادت معه كذلك حتى إذا كان بالمنصف مما بينهما لأم بينهما يعني جمعهما فقال التئما علي بإذن الله فالتأمتا قال جابر فخرجت أحضر مخافة أن يحس رسول الله ﷺ بقربي فيبتعد وقال محمد بن عباد فيتبعد فجلست أحدث نفسي فحانت مني لفتة فإذا أنا برسول الله ﷺ مقبلا وإذا الشجرتان قد افترقتا فقامت كل واحدة منهما على ساق فرأيت رسول الله ﷺ وقف وقفة فقال برأسه هكذا وأشار أبو إسمعيل برأسه يمينا وشمالا ثم أقبل فلما انتهى إلي قال يا جابر هل رأيت مقامي قلت نعم يا رسول الله قال فانطلق إلى الشجرتين فاقطع من كل واحدة منهما غصنا فأقبل بهما حتى إذا قمت مقامي فأرسل غصنا عن يمينك وغصنا عن يسارك قال جابر فقمت فأخذت حجرا فكسرته وحسرته فانذلق لي فأتيت الشجرتين فقطعت من كل واحدة منهما غصنا ثم أقبلت أجرهما حتى قمت مقام رسول الله ﷺ أرسلت غصنا عن يميني وغصنا عن يساري ثم لحقته فقلت قد فعلت يا رسول الله فعم ذاك قال إني مررت بقبرين يعذبان فأحببت بشفاعتي أن يرفه عنهما ما دام الغصنان رطبين

مسلم 7518صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Asceticism and heart-softening matters
Chapter
Hadith of the Hijrah, also called hadith of the saddle
Numbering
Darussalam 7518
Muslim 7518