The story opens in the Talbot drawing room on Jenny's and Foggerty's wedding morning. Jenny's relatives and wedding guests are all in low spirits. None of them care much for Foggerty, and as they discuss the union, it comes out that, although she is fond of Foggerty since they were children together, his main attraction for Jenny was the fact that he claims to have never loved anyone before (like Gwendolen Fairfax [in The Importance of Being Earnest] and her "thing" with the name "Ernest", she doesn't think she can love any man who has loved before).
She had previously been engaged to Walkinshaw, but when Foggerty came back from Australia, he "told on" Walkinshaw, so Jenny engaged herself to Foggerty instead. But Walkinshaw knows that Foggerty has a fiance in Australia: Miss Delia Spiff, a ridiculous (but rich) old woman with a green umbrella (that's what the book says) who, it turns out, is one of Jenny's relatives. Foggerty had proposed to her while destitute in Melbourne, and once he was able to see past her money to the woman, he fled. Walkinshaw won't have to snitch on Foggerty, because, according to the newspaper, Spiff has just arrived in England.
After dropping this bombshell, Walkinshaw leaves Foggerty to brood. While soliloquising over this turn of events, he states that nothing short of a fairy godmother could get him out of this predicament. Well, it turns out that he does have something along that line. The Fairy Rebecca pops up to be of assistance. She had been sorry to see a fine young man throwing himself away on someone like Delia Spiff, and had taken on the job of being Foggerty's Fairy guardian. They start throwing out plans for getting Spiff out of the way, but they all require the help of a bad fairy (Rebecca is a good fairy and can't do them). Finally, Foggerty wishes he could blot Spiff out of his existence.
That, it turns out, is something Rebecca can do, but she warns him that "the consequences of an act are often more numerous and important than people have any idea of." Foggerty's own origin was an excellent example. Many years earlier, the man who was to become Foggerty's father was walking down a street and stopped by a sculptor's shop to admire a monument to some colonel who had died of a cold after jumping in the Ganges to rescue his dog. While Foggerty's to-be father was standing there, an old friend walked up, and ended up inviting him to dinner. While at the dinner, he met the woman who was to become Foggerty's mother. Eventually, they were married, and then came Foggerty. He thinks it's pretty interesting that his life depended on a dinner invitation, but Rebecca points out that he owes his existence to something more remote than that: the invitation resulted from his father's having stopped to admire the monument, which resulted from the colonel's dying of a cold, which resulted from jumping in the Ganges after his dog, which resulted from the union of the dog's father and the dog's mother. If those two dogs had never gotten together, the dog would never have been born, and neither would Foggerty.
He promises to be careful, and Rebecca gives him a little bottle of elixir and a box of pills. If he needs to see her, he should say so and swallow a pill. If he does decide to eliminate a factor in his life, he should name it and drink the potion. She disappears, and Jenny presently enters. They're about to leave for the church, when in walks Delia Spiff. She claims Foggerty in marriage (he was indiscreet enough to put his proposal in writing), Jenny rejects him, and as a last resort, he obliterates Delia Spiff from his existence.
Foggerty is found sleeping on a couch in a different drawing room from that in Act I. Rebecca wakes him, but has to leave him to his own devices, since she got involved with him because of Spiff, and all consequences of his having met her have been wiped, or as they frequently say, "spiffed", out. Foggerty hasn't a clue where he is or why, since his circumstances have been completely changed, but after observing his surroundings and the things in his pockets, and talking to Jenny's bridesmaids (from last act, who are also bridesmaids in this act), he concludes that he is a successful pharmacist about to marry Jenny.
He doesn't know what to make of the "stately lady of middle age and tragical demeanour" Miss de Vere, who seems to be a very close friend, but he is able to excuse himself to dress for, what he expects is, his wedding (you know he's going to be in for an unpleasant surprise). While Malvina melodramatically waits, Jenny enters in her wedding dress. From their conversation, we learn that, first of all, that Jenny is not about to marry Foggerty, and that Malvina has been disappointed matrimonially eighteen times previously. She has recovered substantial damages in her breach of promise lawsuits, though. She also suspects lover Nineteen to be false, but has hopes for lover Twenty.
Jenny invites her to the wedding breakfast, and Miss de Vere retires to Jenny's boudoir to wait for them to return from the church. Walkinshaw, who, it turns out, is Jenny's fiance, enters. Jenny admits that she doesn't care for him much, but since he had never loved any before her, she'll make do. She also tells him (much to his horror) that the pitiful Miss de Vere is in the house. He is lover Nineteen. He is saved any awkward explanations by the reappearance of Foggerty. He is extremely affectionate with Jenny, much to Walkinshaw's chagrin, but he lets it pass since they were children together. He exits to get the wedding party into the carriage, leaving Jenny and Foggerty alone.
Foggerty is at a loss to explain Jenny's coldness and concern for Walkinshaw's feelings, until it finally dawns on him that Walkinshaw, and not he, is about to marry Jenny. Jenny is miserable as well, because it comes out that she has always loved Foggerty, but he never declared his affection for her. She leaves, and Foggerty realizes that it was his flying from Spiff that had previously brought them together (as you recall, he had returned to England, and had interfered with Walkinshaw's romance, which led to his own engagement).
Walkinshaw and Talbot reenter to get the rest of the wedding party, and in a fit of rage, Foggerty roughs up Walkinshaw for stealing the girl he loves. He remembers too late that his previous engagement had been spiffed out, then runs out on the balcony to try to sort things out. Walkinshaw and Talbot begin to express some doubts about his sanity. While they're talking, though, Jenny storms in: she has learned from Miss de Vere that Walkinshaw is her faithless lover. She throws herself into Foggerty's arms (much to her father's dismay, since he thinks Foggerty has flipped), and all would eventually work out well, until Malvina sweeps in to tell Foggerty that her last lover had proved faithless and that she is now free to marry him. Foggerty learns much to his surprise (though not to the audience's) that he is lover Twenty. Jenny faints in horror, and in the excitement, Foggerty jumps off the balcony and runs away.
It is evening in Walkinshaw's parlor (which has the same general arrangement as the Talbot parlor of Act I). Walkinshaw and Talbot are comparing notes on the day's proceedings. Talbot speculates that it's just as well Walkinshaw didn't marry Jenny, since he's no bargain anyway. Talbot has also made arrangements to have Foggerty hauled off as a lunatic. Foggerty, we find, has spent the last eight hours running away from Malvina, who has been in close pursuit. He has finally run back to Walkinshaw's house. Talbot tells Walkinshaw to keep him there until the Commission shows up to take him away, and leaves to notify them.
A knock is heard at the door: Malvina has caught up with Foggerty. She hasn't caught up with Walkinshaw yet, though, so he goes to hide. Foggerty is too tired to move, and Malvina isn't in very good shape, either, when she staggers in. He refuses to marry her, she presents him with a summons, and they fall to dickering about the terms of the damages (six weeks of brooding over a lost love at a pound a day, plus £75 for losing him as a husband, plus £450 for public embarrassment, plus the cost of the trousseau, plus legal costs).
Foggerty finally decides that, since he's lost Jenny, he might as well marry her, which is fine with her. He is then able to confide in her that he has no memory of his past, and Malvina offers to make a list of useful facts about his life. Foggerty goes to straighten out his clothes. As soon as he leaves, Talbot comes back with the Commission: two mental doctors and an asylum attendant. Malvina and Talbot leave, as do the doctors, to prepare their report on Foggerty's mental state (without having seen him, of course). Blogg, the attendant, is told to keep an eye on Foggerty, and to humour him in every way.
Foggerty reenters. He doesn't know what Blogg is doing there, but from his conversation figures out he must be a policeman, and the doctors are detectives. Blogg, naturally, agrees with him. Foggerty decides he must have committed some crime he doesn't know about, and tries to get the information out of Blogg. Blogg agrees with everything, and provides some imaginative responses for Foggerty's "rhetorical" questions, and by the time they're finished, Foggerty thinks he and Walkinshaw have murdered Walkinshaw's aunt.
Walkinshaw then rushes through the room, trying to make his escape from Malvina, and Foggerty promptly collars him for murdering his aunt. Blogg tells him Foggerty's mad, and must not be contradicted, as he takes him into custody. Malvina rushes in after Walkinshaw, who Foggerty denounces as a murderer. Blogg tells her to keep away from him because he's a madman. Talbot reenters to tell Foggerty they've come to take him away.
There's only one thing left for him to do: he summons Rebecca with one of the pills she had given him. She reminds him that she can't help him, since she has been spiffed out, and starts to leave. He points out that he still has forty-seven summoning pills left, and he could make things most uncomfortable for her. She stays. Foggerty further points out that everything relating to his connection with Delia Spiff was not spiffed out: that if he had never known Spiff, he would never have had a problem with her, and therefore he would never have asked Rebecca for help, and therefore she would never have given him the potion to obliterate the event in his past, and therefore, he should never have wound up in this present mess.
Rebecca agrees to restore things to their original condition, without Spiff. The scene changes back to Daytime in the Talbot drawing room. Walkinshaw gets Malvina, Foggerty gets Jenny, and they all go off happily to be married.