Patanjali Yoga Sutra 3.18
Sanskrit Sutra
संस्कारसाक्षात्करणात् पूर्वजातिज्ञानम्॥१८॥
Swami Vivekananda's translation
By perceiving the impressions, (comes) the knowledge of past life.
Vyasa Bhashya (Sanskrit)
द्वये खल्वमी संस्काराः स्मृतिक्लेशहेतवो वासनारूपा विपाकहेतवो धर्माधर्मरूपाः।
ते पूर्वभवाभिसंस्कृताः परिणामचेष्टानिरोधशक्तिजीवनधर्मवदपरिदृष्टाश्चित्तधर्माः।
तेषु संयमः संस्कारसाक्षात्क्रियायै समर्थः।
न च देशकालनिमित्तानुभवैर्विना तेषामस्ति साक्षात्करणम्।
तदित्थं संस्कारसाक्षात्करणात्पूर्वजातिज्ञानपुत्पद्यते योगिनः। परत्राप्येवमेव संस्कारसाक्षात्करणात्परजाति-संवेदनम्।
बुद्धिसत्त्वस्यायं धर्मस्त्रिगुणस्त्रिगुणश्च प्रत्ययो हेयपक्षे न्यस्त इति। दुःखरूपस्तृष्णातन्तुः। तृष्णादुःखसंतापापगमात्तु प्रसन्नमबाधं सर्वानुकूलं सुखमिदमुक्तमिति ॥ १८ ॥
Vyasa Bhashya (English Translation)
Indeed, these impressions (samskaras) are of two kinds: (1) those in the form of latent desires (vasanas) which are the cause of memory and afflictions (kleshas), and (2) those in the form of merit and demerit (dharma and adharma) which are the cause of fruition (vipaka - the fruits of action).
They (the impressions) are accumulated from previous lives; they are unperceived characteristics (dharmas) of the mind, similar to transformation (parinama), movement (cheshta), restraint (nirodha), power (shakti), and vitality (jivana).
Samyama on them is capable of bringing these impressions into direct perception.
And their direct perception is not possible without the experience of the place, time, and cause (associated with them).
Thus in this way, from the direct perception of impressions, the knowledge of past lives arises for the yogi. Similarly, by the direct perception of impressions of others, the knowledge of the past lives of others is obtained.
This characteristic of the intellect (buddhisattva) is composed of the three gunas, and cognition consisting of the three gunas is classed among things to be rejected (heya). The thread of craving (trishna) is of the nature of pain. But by the removal of the torment of pain caused by craving, this tranquil, unhindered, universally favorable happiness is spoken of. || 18 ||
Chapter link: Yoga Sutra Chapter 3

Muni's Play