It is narrated from Sayyidah Asma bint Abi Bakr (may Allah be pleased with her) that the Messenger of Allah (peace and blessings be upon him) said: "The believer sits up in his grave when those who attended his burial turn away from him. It is said to him: The man who is called Muhammad, who is he? If he is a believer, he says: He is the servant of Allah and His Messenger. It is said to him: Sleep; may your eyes sleep (that is, may you find rest). And if he is not a believer, he says: By Allah, I do not know; I heard people saying something, so I said it too, and they talked idly, so I talked idly as they did. It is said to him: Sleep; may your eyes never sleep in peace."
Hadith Referenceالمعجم الكبير للطبراني / مسند النساء / 20601