Question: how did harry potter get the sword of gryffindor in the deathly hallows?
Answer: Wikia summarizes this well: Dumbledore's portrait instructed Snape to give Harry the real sword without Harry knowing that it was Snape, in case Voldemort found out through Legilimency on Harry. Snape deposited the real sword in a frozen lake in the Forest of Dean and left a Patronus to guide Harry to the sword.