Hadith 1609
Abu Hurairah (May Allah be pleased with him) said:
عن أبي هريرة رضي الله عنه قال: بعثنا رسول الله صلى الله عليه وسلم في بعث فقال: "إن وجدتم فلانًا وفلانًا" لرجلين من قريش سماهما "فأحرقوهما بالنار" ثم قال رسول الله صلى الله عليه وسلم حين أردنا الخروج: "إني كنت أمرتكم أن تحرقوا فلانًا وفلانًا، وإن النار لا يعذب بها إلا الله، فإن وجدتموهما فاقتلوهما" ((رواه البخاري)).
The Messenger of Allah (ﷺ) sent us on an expedition and said to us, "If you find so- and-so (he named two persons belonging to the Quraish) commit them to the fire." When we were on the verge of departure, he said to us, "I ordered you to burn so-and-so, but it is Allah Alone Who punishes with the fire. So if you find them put them to death." [Al- Bukhari].
In plain words
The Prophet (peace be upon him) first ordered enemies burned, then withdrew it, saying only Allah punishes with fire, so they should be put to death another way. Punishment by fire belongs to Allah alone.
Reference : Riyad as-Salihin 1609 In-book reference : Book 17, Hadith 99