In chapter 14 of Half-Blood Prince, Harry casts Episkey:
"I can fix that," said Harry, landing beside the two girls, pointing his wand at Demelza’s mouth, and saying "Episkey."
Despite this, chapter 2 of Deathly Hallows shows Harry apparently believing that he doesn't know how to heal wounds:
but he had to admit to himself that this jagged cut in his finger would have defeated him. He had never learned how to repair wounds
Is there an explanation for this apparent contradiction?