The Heir of Linne (Child ballad #267; Roud #111) is a traditional folk song existing in several variants.[1]
The lord of Linne wastes all his money, and sells his land to his steward to get more, and wastes that money as well. No one will lend him money, and he realizes his folly: he could have lived comfortably on his lands.
He remembers a letter that his father left him, or a key that his mother gave him, or tries to hang himself and splits the roof. This leads to his finding chests of gold. He goes back to his old hall, and tries to borrow money from the new owner, who jeers at him, and mockingly offers to sell back the lands for less than the purchase price. The lord agrees and pays, and so gets back his lands.
This appears to be written by Thomas Percy in his Reliques of Ancient English Poetry, rewriting an older ballad with some ideas taken from a second ballad.[2]
Two versions are printed in John S. Roberts's The Legendary Ballads of England and Scotland (1887); one is Percy's version and the other a Scottish version which he describes as "stiff and awkward"; it had been printed in Scottish Traditional Versions of Ancient Ballads by the Percy Society (1846).[3]