It is narrated from Sayyiduna Amr bin Hazm or Sayyiduna Umarah bin Hazm (may Allah be pleased with him): "The Messenger of Allah (peace and blessings be upon him) saw me reclining against a grave and said: 'Get up; do not harm the occupant of the grave, lest he harm you.'" Ahmad bin Mani' recorded it with a chain that contains Ibn Lahi'ah, and Imam al-Nasa'i recorded it in al-Sunan al-Sughra through Sayyiduna Amr bin Hazm (may Allah be pleased with him) as marfu' with the words: "Do not sit on graves."
Hadith Takhrij«رواه أحمد بن منيع بسند فيه ابن لهيعة» «أخرجه مسند أحمد برقم: 27918، وأخرجه فتح الباري برقم: 1295، وأخرجه المستدرك على الصحيحين برقم: 6561، وأخرجه شرح معاني الآثار برقم: 2944»