The practice of yoga has been thought to date back to pre-vedic Indian traditions; possibly in the Indus valley civilization around 3000 BCE. Yoga is mentioned in the Rigveda and also referenced in the Upanishads,though it most likely developed as a systematic study around the 5th and 6th centuries BCE, in ancient India’s ascetic and Śramaṇa movements.
Description of an early form of yoga called nirodhayoga (yoga of cessation) is contained in the Mokshadharma section of the 12th chapter (Shanti Parva) of the Mahabharata. Nirodhayoga emphasizes progressive withdrawal from the contents of empirical consciousness such as thoughts, sensations etc. until purusha (Self) is realized. Terms like vichara (subtle reflection), viveka (discrimination) and others which are similar to Patanjali’s terminology are mentioned, but not described. There is no uniform goal of yoga mentioned in the Mahabharata. Separation of self.
The earliest extant systematic account of yoga and a bridge from the earlier Vedic uses of the term is found in the Hindu Katha Upanisad (Ku), a scripture dating from about the third century BCE It describes the hierarchy of mind-body constituents—the senses, mind, intellect, etc.—that comprise the foundational categories of Sāmkhya philosophy, whose metaphysical system grounds the yoga of the Yogasutras, Bhagavad Gita, and other texts and schools.