Read the full text of As You Like It Act 5 Scene 4 with a side-by-side translation HERE.
Orlando and Duke Senior confer, each professing hope that Ganymede can keep all of his promises.
Rosalind/Ganymede enters, and for dramatic effect, s/he makes Silvius, Phoebe, and Orlando promise to do what s/he says: Orlando must swear to marry Rosalind if Ganymede can produce her; Phoebe must promise to marry Silvius if she doesn't want to marry Ganymede; Silvius must swear that he will marry Phoebe if Phoebe will have him.
As Rosalind/Ganymede leaves with Celia/Aliena, Orlando and Duke Senior note the resemblance between the Ganymede and Rosalind. How curious!
Now we get back to Jaques, who comments that a flood must be coming because of all the couples are pairing up just like the animals that entered Noah's ark in twosies.
Touchstone and Audrey arrive. Jaques and Duke Senior talk about how witty Touchstone is.
As they chatter, Hymen, goddess of marriage, enters with Rosalind and Celia, who have ditched their Ganymede and Aliena costumes and are ready to get hitched to their men. Let the recognition begin!
Duke Senior recognizes his daughter, Orlando recognizes his love, and Phoebe recognizes that she has to marry either Silvius or a woman.
Hymen pronounces that the four couples—Orlando and Rosalind, Oliver and Celia, Silvius and Phoebe, and Touchstone and Audrey—will all be joined in marriage.
Before the crowd can celebrate by eating wedding cake and doing the chicken dance, Jaques de Boys, brother to Orlando and Oliver, makes a dramatic entrance.
Jaques de Boys (not to be confused with just plain Jaques the moody clown) delivers some good news: Duke Frederick had raised an army, intending to murder and pillage Duke Senior's forest hideaway.
No, that's not the good news. The good news is that just as Duke Frederick was leading that army to the forest, he stopped and had a chat with an old religious man.
The man instantly convinced Frederick not to murder his brother in cold blood, and to leave the courtly world and give up all his worldly possessions.
Well, Duke Senior gets his dukedom back, which Orlando will now inherit because he's marrying into the family. Oliver also gets his land and title back, which is good. Now everyone, including Duke Senior, can return to the court and get out of that forest.
Before they return, though, they agree to party like it's 1599.
Jaques, still melancholy, doesn't join the dance but goes instead to join Duke Frederick in the religious life. This is fitting, because if anyone deserves to be harassed by the melancholy Jaques, it's good ol' Duke Frederick.
Everyone goes back to dancing and general merriment until they all exit, leaving only Rosalind on the stage.