Hadithcore
Hadith #2304770
sahih· Al-Albani

Anas ibn Malik reported that the Prophet, (ﷺ), said, "If the Final Hour comes while you have a shoot of a plant in your hands and it is possible to plant it before the Hour comes, you should plant it."

حَدَّثَنَا أَبُو الْوَلِيدِ، قَالَ‏:‏ حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ هِشَامِ بْنِ زَيْدِ بْنِ أَنَسِ بْنِ مَالِكٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ‏:‏ إِنْ قَامَتِ السَّاعَةُ وَفِي يَدِ أَحَدِكُمْ فَسِيلَةٌ، فَإِنِ اسْتَطَاعَ أَنْ لاَ تَقُومَ حَتَّى يَغْرِسَهَا فَلْيَغْرِسْهَا‏.‏

References2 variants
Sunnah.com reference
Book 27, Hadith 4
Arabic/English book reference
Book 27, Hadith 479