Mom just doesn't understand! She tells our heroine off for going out with the wrong boy or having a secret life, etc. Then, we find out in a dramatic twist that she did the same thing when she was her age! What a hypocrite! But, of course, having seen her hypocritical ways, we love her again or she sees her wrong-doing and allows the act to continue. Or doesn't.
The other case is when the parent has forgotten what it's like to be a teenager. In this case, some other adult their age will remind them, "you were a teenager once, don't you remember?" prompting the parent to guiltily admit they remember, and that's why they're being so overprotective.
Note that this trope isn't necessarily a bad thing: the parents went through the same thing their children are facing, learned from it, and now they want to keep their kids out of the same situations. The parents look upon the situation with regret and want better for their children. Not stopping to remember how much they'd heed such advice in their time, of course. This trope only focuses on the fact that the parent did the same as the child and it is considered a "twist" in the story.
On the other hand, the unsympathetic side of this is when the parent disciplines the child for doing something that they still do as a parent, rather than something they did as a kid, learned a lesson from, and don't do anymore.
Possibly a subtrope of Generation Xerox. The parent or guardian involved is often a Former Teen Rebel.
The classic 1987 PSA where the teen son is being blasted by his dad for taking drugs, asks him where he learned to do that from, and the son starts screaming "It was from YOU, alright?! I learned it from watching YOU!"
One Piece: Garp is about to beat on Luffy when they both fall asleep. When Garp wakes up later, he then wails on Luffy for falling asleep despite having done so himself.
A teacher example: Kuroi Sensei from Lucky Star plays the same online game as Konata, and has been into MMORPG's since before she was Konata's age, but she tells Konata off for doing that very thing, and uses in-game chat to remind her to do her homework. When Konata calls her out on this, she remarks that, as a teacher, she has a duty to uphold, which Konata accepts as understandable, but still...
In Spider-Girl, this is an issue early on—Peter is horrified that teenage May would try to be a superhero, despite doing the same thing at her age. (He has a good reason to want her not to here; being a superhero cost him his leg.)
Nico Minoru's parents raised her to be a devout Catholic and discouraged her Gothic habits, but she later finds out that they themselves are dark wizards. When the team later goes back in time to 1907, she also discovers that her ancestor was a "reformed" Dragon Lady who tortured suspected "heretics" (basically, other magic-users) on behalf of a group of super-powered xenophobes.
Then there's Excelsior, a team of ex-teen heroes who try to get the Runaways out of the hero game...by putting their old costumes back on and fighting them. When called on this, Turbo invokes the trope. "It's like my mom always said, Jono. 'Do as I say, not as I do.'"
In Lilly Epilogue Family Matters, Mr. Satou derides Hisao for being a "middle class bumpkin" despite marrying a journalist, who is not in a well-paying career. However, later on, it is indicated that this attitude is because he wanted to believe Hisao was unworthy of Lilly.
Films — Animated
The Lion King II: Simba's Pride has Simba very over-protective of Kiara. At one point, Nala points out to Simba that Kiara's just like they were when they were cubs, and Simba explains that this is what worries him.
In The Notebook, Allie's mother scoffs at Allie falling in love a day-laborer in the first act. In the third act, however, she shows Allie that she once loved a day-laborer as well, but instead married Allie's father. She still has feelings for the working man as well.
In Back to the Future, Marty's mother scoffs at Marty for his behavior with Jennifer. "In my day, we never parked and made out." It's quite the shock to Marty when he travels back in time to find his mother willing to "park for a while" (not to mention drinking and smoking).
In The Patriot, Gabriel spends the night with his fiancee, Anne Howard, and her family. Mrs. Howard sews Gabe into a bundling bag for the night, to keep him and Anne from getting up to anything. Afterwards, Gabe and Anne talk, while her dad listens nervously at the door.
Mrs. Howard: Don't worry, I'm a better seamstress than my mother was.
Mr. Howard:[mortified] I hope so!
Minor example occurs in A Christmas Story. When the protagonist uses a cuss word, and his mother demands to know where he heard it, the voice-over narrator (which is the protagonist as an adult) claims that he had heard his father say it a lot. (And to be honest, that's often the case with kids and bad language.) Still, he doesn't have the nerve to tell his mother that.
In Matchstick Men, Roy the Con Man is strongly opposed to teaching Angela his tricks of the trade, and makes her return the takings of her first scam.
Roy: "I told you I'd teach you a con. I didn't say I'd let you get away with it."
In A Civil Campaign by Lois McMaster Bujold, two parents get upset about their daughter having premarital sex. A family friend shuts them up by quietly bringing the couch where they first had sex — before they were married, of course — out of storage.
In one of the Berenstain Bears books, there's a mild version involving a school dress code. The kids adopt obnoxious new fashions, and due to an escalating power struggle between the acting principal who keeps making new rules and the kids using Loophole Abuse, it looks like the school will be going to uniforms... until Grandma Bear defuses the situation by hauling out photos of Papa and Mama Bear in their ludicrous Seventies attire.
The Sweet Valley Saga novel The Wakefield Legacy featured Theodore Wakefield, the great-great-great grandfather of the Sweet Valley twins, running away from home to avoid an arranged marriage. When Theodore's daughter Sarah was old enough to marry, however, he insisted that she marry the man of his choice rather than the man she loved. Sarah immediately calls him out on his hypocrisy. He doesn't even bother to justify himself, continuing to insist on his right to veto Sarah's choice. This leads to a split between the two that is never healed.
In David Weber's War God series, Baroness Hanatha Bowmaster is forced to forbid her daughter Leeana from doing many of the things that Hanatha enjoyed doing at Leeana's age. In an unusual twist for this trope, Hanatha is the one who brings up the fact that she and Leeana's father were guilty of the same and worse, and Hanatha is well aware that she's being hypocritical and unfair. She justifies herself, however, by pointing out that (a) She's learned from her experiences and doesn't want Leeana to have to go through the same thing, and (b) Leeana's situation is far more precarious than Hanatha's was.
In Eyes of a Child by Richard North Patterson, Chris Paget finds his son Carlo smoking marijuana and Lampshades this trope by thinking that this was the sort of moment every parent who grew up in The Sixties dreads. Chris ends up admitting to Carlo that yes, he did smoke pot and it didn't kill him or ruin his life, but it just made him kind of dumb and wasn't really worth it.
In Harry Potter, one of the reasons Molly Weasley opposes Bill marrying Fleur is that they haven't known each other very long, and the only reason they're rushing into it is because they know Voldemort's back and they could all die at any moment. Ginny quickly points out that that was exactly what happened with Molly and Arthur. Molly replies with "Yes, well, your father and I were made for each other so what was the point in waiting?" before swiftly launching into a tirade about all the other things she hates about Fleur. Fleur goes some way to proving them wrong by the end of the book, when she stays totally loyal to Bill despite him being hideously mauled by Fenrir Greyback.
A Song of Ice and Fire has various instances of the older generation criticising the younger one for doing things like recklessly going to war, despite having done the same thing at that age. A very dark example of this is Tywin's fury over Tyrion's use of whores, only for it to turn out that he uses one who had previously been with Tyrion.
In Smallville, Jor-El is worse than most examples because he didn't do it when he was young. In Arrival, he almost killed Chloe because she was holding Clark back, and she is alive only because of Clark's interference. In Lazarus, he berates Clark for almost killing a psychopathic Lex clone (who set off traps to kill Lois Lane and a bunch of other people), in which case Clark stopped himself from doing it.
Gilmore Girls: Lane's mom, a strict Christian, eventually found out that she was hiding her life away from her. How she found out was a mystery to us for a long while (how did she know to look under the floorboards?). Then, on Lane's wedding day, we find out that Mrs. Kim hid her life away from her mother (a strict Buddhist) under the floorboards, and still does to this day! And she needs to hide her lifestyle fast before her mother arrives for the wedding!
Veronica Mars runs a booming business in high school exposing the hypocrisies of parents for their children.
On Home Improvement Tim and Jill catch their son Brad with marijuana. He deduces that they've used it before based on the fact that they were alive during "that whole hippie thing", which turns out to be true in Jill's case (Tim preferred beer). The parents discuss whether they should tell Brad the truth, and eventually, they do and she explains the trouble it caused her and that it was a mistake she doesn't want him to make.
In Modern Family, it's revealed that Claire has a rebellious past (including being driven home by the police in her underwear) despite reprimanding Hayley for similar behavior.
Still Standing: The parents were complete Jerkasses in high school, so they often run into this trope when disciplining their children.
Trisha Yearwood's "She's in Love With the Boy" is about a girl who's in love with a boy while her father complains about how stupid and worthless the boy is. After the boy and girl come home late from a date, the father's about to berate the boy, but the mother reminds him that her father used to think the same way about him when they were younger.
The Beastie Boys' "(You Gotta) Fight For Your Right (To Party)" has this line:
Your pop's caught you smoking and he says, "No way!" That hypocrite smokes two packs a day!
In FoxTrot, Andy complains to her mom about sending Peter music that annoys her, defending her claim with "But the music I annoyed you with was good!"
It's a running gag with Andy to tell her family not to do something such as procrastinate, only to go procrastinate just as badly as they do. Another example of this is telling Jason to stop playing a violent video game only to get hooked on it even worse after he convinces her to try it.
Similar to the above, this is a punchline in The Buckets. The father complains about how his childrens' music is nothing but noise, prompting his father to stand there smiling because that's the exact same thing that he said about his music when he was younger.
Discussed in a rehearsal scene in The Convict's Opera.
Director: There is a question to consider. Peachum and his wife — are they both angry with their daughter, I mean, equally angry? Perhaps Mrs Peachum is less angry because she, in her youth, has made the same mistakes that Polly does. Actress playing Mrs Peachum: That would make her more angry. At least, it would make me more angry.
Girl Genius has a moment when Gilgamesh jumps in to play corrida with what amounts to a small locomotive with legs and arms, giving his father time to analyze its structure. Klaus roars at him for taking an unnecessary risk, but Jägermonsters eagerly express approval when they see a Bad Ass performance, so right at the next page a Jäger sergeant quietly tells Gil that Klaus himself "doz crazy schtupid sctoff like dot all de time". Of course, as they both are mad scientists with chronic anti-hero syndrome, it wasn't likely to be the craziest for either.
Ki's father in General Protection Fault strongly disapproves of her for dating and planning on marrying the non-Japanese Nick, but when he was younger and less conservative, he married a Chinese woman. Both Nick and Ki eventually bring that factor up when trying to get him to approve of their relationship, and they succeed.
In The Simpsons, Homer is upset because his 10 year old son Bart got his ear pierced.
Bart: Come on, Dad. Didn't you ever do anything wild when you were a kid? Homer: Well, when I was ten I got my ear pierced. But this is completely different!
In As Told by Ginger Ginger's mom Lois forbids her pre-teen daughter things like using makeup and shaving her legs, but it's immediately shown that Lois have a whole bathroom full of beauty products that she keeps locked. This may be because Lois believes that Ginger is too young to be using those things.
In Star Wars: The Clone Wars, Anakin Skywalker, in trying to train his padawan, Ahsoka Tano, often has to teach her not to do the very things which defined his character in the prequel trilogy (and to some extent still do in the series itself).
In one episode of The Powerpuff Girls, the girls learn a cuss word from Professor Utonium, and spend the whole day saying it. Later, he scolds them for doing so, and is very embarrassed when they tell him, in front of the whole town, that they heard it from him. (He tries to tell everyone watching that it's probably really because of cable, but he's more honest with the Girls.)
Discussed in the Darkwing Duck episode Apes of Wrath, Darkwing tells Launchpad to remain calm, then immediately yells at the gorilla to tell him where Gosalyn is. He fully acknowledges he's being hypocritical, and cites this trope as his defense.
"Okay, I don't practice what I preach. I'm a parent. I can get away with it."
In Green Lantern: The Animated Series, Hal complains about Aya ignoring his orders to do something risky but heroic, when this kind of behavior practically defines his character (no points for guessing where she learned it from). Kilowog calls him on it immediately.