"Prior Incantato is an incantation that can be used to reveal the most recent spell performed by a wand."
From the Story
Discovered in Book 4, Chapter 9, The Dark Mark
"Amos Diggory uses Prior Incantato to find out whether Harry's wand was used to conjure the Dark Mark. Placing his wand tip to tip against Harry's wand and saying the spell, Amos causes a shadow of the Dark Mark to erupt from where the two wands meet, showing that this was the last spell cast with Harry's wand."