The Prophet of Allah ﷺ gave orders concerning twenty-odd men from the chiefs of Quraysh, and they were cast into one of the wells of Badr, foul and made fouler.Whenever he prevailed over a people, he would remain in their open ground for three nights. When he prevailed at Badr, he stayed for three nights. On the third day, he ordered that his mount be prepared, and its saddle was fastened. Then he set out walking, and his companions followed him.They said, "We think he is only going to relieve himself."He stopped at the edge of the well and began calling out to them by their names and the names of their fathers, "So-and-so, son of so-and-so, would it have pleased you if you had obeyed Allah and His Messenger? We have indeed found what our Lord promised us to be true. Have you found what your Lord promised you to be true?"Umar said, "Prophet of Allah, why do you speak to bodies that have no souls in them?"He said, "By the One in whose hand is the soul of Muhammad, you do not hear what I say better than they do."Qatada said, Allah brought them back to life for him so that they could hear his words as a rebuke, a humiliation, and a punishment.
حدثنا يونس حدثنا شيبان عن قتادة عن أنس قال
أن نبي الله ﷺ أمر ببضعة وعشرين رجلا من صناديد قريش فألقوا في طوى من أطواء بدر خبيث مخبث قال وكان إذا ظهر على قوم أقام بالعرصة ثلاث ليال قال فلما ظهر على بدر أقام ثلاث ليال حتى إذا كان الثالث أمر براحلته فشدت برحلها ثم مشى واتبعه أصحابه قالوا فما نراه ينطلق إلا ليقضي حاجته قال حتى قام على شفة الطوى قال فجعل يناديهم بأسمائهم وأسماء آبائهم يا فلان بن فلان أسركم أنكم أطعتم الله ورسوله هل وجدتم ما وعدكم ربكم حقا قال عمر يا نبي الله ما تكلم من أجساد لا أرواح فيها قال والذي نفس محمد بيده ما أنتم بأسمع لما أقول منهم قال قتادة أحياهم الله عز وجل له حتى سمعوا قوله توبيخا وتصغيرا ونقيمة
Its isnad is sahih. Shayban is Ibn Abdul-Rahman Nahwi, and Bukhari narrated the hadith in 7/300, no. 3976, in the book of Maghazi, chapter on the killing of Abu Jahl, and it is found among the group of scholars with other wordings.