Question: where did neville get the sword of gryffindor?
Answer: Neville got the sword during the Battle of Hogwarts when the Sorting Hat provided it to him. Time and again, it has been said, that the sword will present itself to any worthy Gryffindor in a time of need. This being said, the Hat had proved that this is true as it came to Harry in the Chamber of Secrets.