During Q’s second appearance, “Hide and Q,” Picard lures Q (who behaves very differently than in any other episode) into a wager:
Q: Shall we wager on that, Captain? Your starship command against?
PICARD: Against your keeping out of humanity's path for ever. Done?
Q: Done! You've already lost, Picard. Riker will be offered something impossible to refuse.
At the end of the episode, Picard wins:
PICARD: Pay off your wager.
Q: I recall no wager!
PICARD: I'm sure your fellow Q remember you agreed to never trouble our species again. Just as they're aware you failed to tempt a human to join you.
Behind the scenes, “Hide and Q” was intended at the time to write Q out of the series forever, but the producers liked Patrick Stewart and John De Lancie’s chemistry. And the writers later thought of a great idea for another Q episode.
So, the next time we see Q, in “Q Who,” Q is focused on Picard instead of Riker, and everyone remembers Q having made a very different wager.
PICARD: We agreed you would never trouble my ship again!
Q: I always keep my arrangements, sir. Look, we're nowhere near your vessel.
And no one ever remembers what he originally said or calls him on it.
Yes, Q, you would never cheat your way out of one of your wagers, and you would especially never offer a wager to have Picard do the very thing to himself that you gleefully tricked him into a wager to do to himself in “Tapestry”—to teach him a lesson, which he would not have learned had you simply snapped your fingers and done that to him. Knowing all along that you could change the timeline if you lost.
Or, as Lucas Bachmann astutely asks: did that really happen? At the end of “Tapestry,” Picard isn’t sure. Perhaps his own subconscious combined his regrets over how he got the artificial heart that was killing him, the lesson in humility that Q taught him in “Q Who,” and the wager Q offered him to give up his starship command in “Hide and Q,” where Q’s true purpose was to test whether a human would refuse Q and keep his own integrity at the cost of embracing his own mortality. And Picard definitely does remember that he made some bet with Q.