There are many spells that could be considered "countercurses," in that they negate or reverse the effects of a curse.
Snape seems to know a countercurse for Sectumsempra:
The door banged open behind Harry and he looked up, terrified: Snape
had burst into the room, his face livid. Pushing Harry roughly aside,
he knelt over Malfoy, drew his wand, and traced it over the deep
wounds Harry’s curse had made, muttering an incantation that sounded
almost like song. The flow of blood seemed to ease; Snape wiped the
residue from Malfoy’s face and repeated his spell. Now the wounds
seemed to be knitting.
—Harry Potter and the Half-Blood Prince
While this could simply be a generic healing spell, the fact that Snape invented Sectumsempra, and did not fail to have a countercurse for his other invention, Levicorpus, suggests otherwise.
The Stunning Spell (Stupefy) can be reversed by Rennervate:
“Stunned,” he said softly. His half-moon glasses glittered in the
wandlight as he peered around at the surrounding trees.
“Should I go and get someone?” said Harry. “Madam Pomfrey?”
“No,” said Dumbledore swiftly. “Stay here.”
He raised his wand into the air and pointed it in the direction of
Hagrid’s cabin. Harry saw something silvery dart out of it and streak
away through the trees like a ghostly bird. Then Dumbledore bent over
Krum again, pointed his wand at him, and muttered, “Rennervate.”
—Harry Potter and the Goblet of Fire
Levicorpus, of course, had a counterspell:
She raised her wand, pointed it at Harry, and whispered, “Levicorpus.”
[...]
“Liberacorpus!” yelled Harry, and with a crash he and Griphook
landed on the surface of the swelling treasure, and the sword flew out
of Harry’s hand.
—Harry Potter and the Deathly Hallows
Petrificus Totalus has some kind of countercurse:
There was a flash of red light and Harry’s body unfroze; he was able
to push himself into a more dignified sitting position, hastily wipe
the blood off his bruised face with the back of his hand, and raise
his head to look up at Tonks, who was holding the Invisibility Cloak
she had just pulled away.
—Harry Potter and the Half-Blood Prince
It is very possible that this spell is indeed Rennervate, which produced a similar effect when Harry attempted to use it to revive Dumbledore:
“No!” shouted Harry, who had stood to refill the goblet again; instead
he dropped the cup into the basin, flung himself down
beside Dumbledore, and heaved him over onto his
back; Dumbledore’s glasses were askew, his mouth agape, his eyes
closed. “No,” said Harry, shaking Dumbledore, “no, you’re not dead,
you said it wasn’t poison, wake up, wake up — Rennervate!” he cried,
his wand pointing at Dumbledore’s chest; there was a flash of red
light but nothing happened. “Rennervate — sir — please —”
—Harry Potter and the Half-Blood Prince
All of these seem to involve a specific incantation, whether verbal or nonverbal. However, note that Harry tried to use Rennervate on Dumbledore when he was unconscious, and Tonks may well have used it to free him from the Full Body-Bind, so some counterspells may work on multiple curses.
There does not, however, appear to be some generic formula for counterspells or countercurses (such as saying the words backwards), as there is in some works.