When he wakes up he realizes that it was only a dream and thinks no more about it. The only difference between eh dream and the phenomenal world is that a dream is an individual illusion of one man whereas the phenomenal world is a collective illusion shared by all souls that have not attained liberation. Moksa is when one admits to no distinction between liberated soul and absolute soul. The word Yoga is etymologically related to the English work yoke and meands union. Yoga is both a speculative school and a praxis.
Some scholars argue for a much earlier date.
While the Yoga Sutra is the text of a discrete system of thought, it informs the meditative practices of other systems, in particular, Samkhya. I am not qualified to recommend one over another, but I find that of Sanderson Beck a coherent translation. The Yoga Surta describes eight steps of advanced techniques for those who have already prepared themselves by eliminating mental turmil and desire. As an advanced ascetic technique it aims to do away with normal consciousness for a consciousness that can comprehend the truth. Samadhi is a state of contemplation in which thought grasps the form of the object directly without the help of categories and the imagination.