The Messenger of Allah ﷺ said, "A man passed by a tree branch lying across a road and said, 'By Allah, I will move this aside so it does not harm the Muslims.' For this he was admitted into Paradise."In another narration, "I saw a man enjoying himself in Paradise on account of a tree he had cut away from the road, which had been harming people."
قال رسول الله ﷺ: مر رجل بغصن شجرة على ظهر طريق، فقال: والله لأنحين هذا عن المسلمين لا يؤذيهم فأدخل الجنة وفي رواية: لقد رأيت رجلا يتقلب في الجنة، في شجرة قطعها من ظهر الطريق، كانت تؤذي الناس.
Muslim narrated it in his chapter on Righteousness and Kinship Ties (1914: 128), following hadith (2617), from Zuhayr bin Harb, who said, Jareer told us, from Suhayl, from his father, from Abu Hurairah, who said, and then he related it.He also narrated it (1914: 129) from Abu Bakr bin Abu Shayba, who said, Ubaydullah told us, Shayban told us, from Amash, from Abu Salih, from Abu Hurairah, who related it with the second wording.Abu Dawud narrated it (4245) through the route of Muhammad bin Ajlan, from Zayd bin Aslam, from Abu Salih, from Abu Hurairah with similar wording, and in it, "A man who had never done any good at all removed a thorny branch from the road." Its chain is hasan because of Muhammad bin Ajlan, for his hadith is hasan.As for his saying, "had never done any good at all," it means apart from Islam.