The Messenger of Allah ﷺ said, "Go to those two trees and cut a branch from each of them. Bring them back, and when you reach where I am standing, throw one branch to your right and the other to your left."Jabir said, "I did so, then I asked, 'Messenger of Allah, why did you have me do that?'"He replied, "I passed by two graves whose occupants were being punished, and I wished, through my intercession, that their torment be eased for as long as the two branches remain moist."
قال رسول الله ﷺ: فانطلق إلى الشجرتين، فاقطع من كل واحدة منهما غصنا، فأقبل بهما حتى إذا قمت مقامي، فأرسل غصنا عن يمينك وغصنا عن يسارك. قال جابر: فقلت: قد فعلت يا رسول الله فعم ذاك؟ قال: إني مررت بقبرين يعذبان فأحببت بشفاعتي أن يرفه عنهما ما دام الغصنان رطبين.
Muslim narrated it in Zuhd wa Raqaiq (3012) through multiple routes from Hatim bin Ismail, from Yaqub bin Mujahid Abu Hazra, from Ubada bin Walid bin Ubada bin Samit, from Jabir, in a long hadith, and it is mentioned in Dalail Nubuwwah. His saying, "yurraffahu," means "he lightens." It does not mention the reason for the punishment, and the hadiths that follow explain that it was because of urine.