Question: how does harry get the sword of gryffindor back from griphook?
Answer: After Griphook took the Sword of Gryffindor from Harry, it was with Griphook until Neville pulled it out of the Sorting Hat when the Dark Lord had put the hat on him. Neville was able to get the sword the same way Harry did - by being a worthy Gryffindor.