Srimad Bhagavatam Canto 05, Chapter 08, Text 27

SB 5.8.27

tadanim api parsva-vartinam atmajam ivanusocantam abhiviksamano mrga evabhinivesita-mana visrjya lokam imam saha mrgena kalevaram mrtam anu na mrta-janmanusmrtir itaravan mrga-sariram avapa.
 
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
At the time of death, the King saw that the deer was sitting by his side, exactly like his own son, and was lamenting his death. Actually the mind of the King was absorbed in the body of the deer, and consequently — like those bereft of Krsna consciousness — he left the world, the deer, and his material body and acquired the body of a deer. However, there was one advantage. Although he lost his human body and received the body of a deer, he did not forget the incidents of his past life.
 
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada: 
 
There was a difference between Bharata Maharaja’s acquiring a deer body and others’ acquiring different bodies according to their mental condition at the time of death. After death, others forget everything that has happened in their past lives, but Bharata Maharaja did not forget. According to Bhagavad-gita:
 
yam yam vapi smaran bhavam
 tyajaty ante kalevaram
tam tam evaiti kaunteya
 sada tad-bhava-bhavitah
 
“Whatever state of being one remembers when he quits his body, that state he will attain without fail.” (Bg. 8.6)
 
After quitting his body, a person gets another body according to his mental condition at the time of death. At death, a person always thinks of that subject matter in which he has been engrossed during his life. According to this law, because Bharata Maharaja was always thinking of the deer and forgetting his worship of the Supreme Lord, he acquired the body of a deer. However, due to his having been elevated to the topmost platform of devotional service, he did not forget the incidents of his past life. This special benediction saved him from further deterioration. Due to his past activities in devotional service, he became determined to finish his devotional service even in the body of a deer. It is therefore said in this verse, mrtam, although he had died, anu, afterwards, na mrta janmanusmrtir itaravat, he did not forget the incidents of his past life as others forget them. As stated in Brahma-samhita (5.54), karmani nirdahati kintu ca bhakti-bhajam. It is proved herein that due to the grace of the Supreme Lord, a devotee is never vanquished. Due to his willful neglect of devotional service, a devotee may be punished for a short time, but he again revives his devotional service and returns home, back to Godhead.
Srimad Bhagavatam Canto 05, Chapter 08, Text 26
Srimad Bhagavatam Canto 05, Chapter 08, Text 28