One night nearly 140 years ago, Samuel Clemens told his young daughters Clara and Susie a bedtime story about a poor boy who eats a magic flower that gives him the ability to talk to animals.

Storytelling was a nightly ritual in the Clemens home. But something about this particular tale must have stuck with Clemens, better known as Mark Twain, because he decided to jot down some notes about it.

The story might have ended there, lost to history. But decades later, the scholar John Bird was searching the Twain archives at the University of California, Berkeley, when he came across the notes for the story, which Twain titled “Oleomargarine.” Mr. Bird was astonished to find a richly imagined fable, in Twain’s inimitable voice. He and other scholars believe it may be the only written remnant of a children’s fairy tale from Twain, though he told his daughters stories constantly.