The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"If wise, thou ’lt loiter not."--This story was told by the Master at Jetavana about Anātha-piṇḍika. For we hear that Anātha-piṇḍika was returning from the village of which he was headman, when he saw robbers on the road. "It won't do to loiter by the way," thought he; "I must hurry on to Sāvatthi." So he urged his oxen to speed  and got safely into Sāvatthi. Next day he went to the monastery and told the Master what had befallen him. "Sir," said the Master, "in other times too the wise and good espied robbers on the road and hastened without delay to their homes." Then at the merchant's request he told this story of the past.
Once on a time when Brahmadatta was reigning in Benares, the Bodhisatta was a rich merchant, who had been to a village to collect his dues and was on his homeward way when he saw robbers on the road. At once he urged his oxen to their topmost speed and reached home in safety. And as he sat on his couch of state after a rich repast, he exclaimed, "I have escaped from the robbers' hand to mine own house, where fear dwells not." And in his thankfulness he uttered this stanza:--
So, from the fulness of his heart, spake the Bodhisatta, and after a life of charity and other good deeds he passed away to fare according to his deserts.
His story ended, the Master identified the Birth by saying, "I was the merchant of Benares of those days."