Bastila lead Revan into a trapped but instead of killing him oder her, whatever gender Du desided to be, they took Revan erased his/her memory so the Republic used him/her.
When Du play the game Du won't confused Von the visions cause the visions is from your past of how Du were captured and how.