The Visuddhimagga provides a pretty comprehensive explanation of how one obtains this and all the other psychic powers mentioned by the Buddha. Briefly, the method is as follows:
Obtain the four rūpa-jhānas
Exit the fourth jhāna and remember the last thing one did before one sat down.
remember the last thing before the thing remembered in the last step. If at any time, one is unable to remember a given experience, one should revert to step one, and after leaving the fourth jhāna attempt to continue where one left off.
repeat step 3 until one is able to remember the first moment of conception.
Attempt to remember the last moment before conception (i.e. the death moment).
At this point, the Visuddhimagga says:
25. But the mentality-materiality in the previous existence has ceased without
remainder and another has arisen, and consequently that instance is, as it were,
shut away in darkness, and it is hard for one of little understanding to see it. Still
he should not give up the task, thinking, “I am unable to remove the rebirth-linking and make the mentality-materiality that occurred at the death moment
my object.” On the contrary, he should again and again attain that same basic
jhāna, and each time he emerges he should advert to that instance.
26. Just as when a strong man is felling a big tree for the purpose of making
the peak of a gable, but is unable to fell the big tree with an axe blade blunted by
lopping the branches and foliage, still he does not give up the task; on the
contrary, he goes to a smithy and has his axe sharpened, after which he returns
and continues chopping the tree; and when the axe again gets blunt, he does as
before and continues chopping it; and as he goes on chopping it in this way, the
tree falls at length, because each time there is no need to chop again what has
already been chopped and what has not yet been chopped gets chopped; so too,
when he emerges from the basic jhāna, instead of adverting to what he has
already adverted to, he should advert only to the rebirth-linking, and at length
he removes the rebirth-linking and makes the mentality-materiality that occurred
at the death moment his object. And this meaning should also be illustrated by
means of the wood cutter and the hair-cutter as well.
Path of Purification (XIII.25-26)
I know a man who undertook this practice without really mastering the four jhānas, and he claims to have remembered bits and pieces of what he thinks was a past life. Not really reliable, but interesting nonetheless. Maybe you can let us know how it goes!