"[You're n]ot the greatest sorcerer in the world,"... "Sorry to disappoint you and all that, but the greatest wizard in the world is Albus Dumbledore."
Harry kills the Basilisk and uses its fang to destroy the diary, therefore destroying Riddle and saving Ginny’s life. Gilderoy Lockhart’s memory is destroyed when he attempts to Obliviate Ron and Harry and get out of the Chamber.
Later that night, the Petrified people are restored using Mandrake Draught.
original artwork Â© Agata Matteucci, used by permission
When Harry uses the Resurrection Stone to have his parents and their friends accompany him into the forest to meet Voldemort, these dead people are described as similar to the spirit version of Riddle from the diary (DH34). -BB