@skye @carl @FinalOverdrive officially its ancestor is Vedic Sanskrit (https://en.wikipedia.org/wiki/Vedas), think of it like the Hebrew in the Torah. It is attested in the Vedas shown above and related literature compiled over the period of the mid-2nd to mid-1st millennium BCE. It is orally preserved, predating the advent of writing by several centuries. It helped a lot with reconstructing both PIE and Proto-Indo-Iranian (which would be the grandfather of Sanskrit) history because we have an extensive body of works in Vedic Sanskrit. The separation of Proto-Indo-Iranian language into Proto-Iranian and Proto-Indo-Aryan is estimated to have occurred around or before 1800 BCE (iirc). As for Proto-Indo-Iranian which I think is more interesting (which is the ancestor of the Proto-Indo-Aryan and obviously Proto-Iranian languages), people estimate it that it separated from PIE in 3000 BCE (quite early actually) and people believe (but it's not settled) that it might form a subgroup along with Greek, Armenian and Phrygian on the basis of many striking similarities in the morphological structure.
After Vedic Sanskrit we have Classical Sanskrit. It's what dialect Pāṇini standardized and formalized in writing, essentially being documenting the language and is the standard for Sanskrit today. He documented Sanskrit in more depth than Greek or Latin grammarians, he used the terminology and methodology that's pretty close to what we have today. Despite differences in the analysis from that of modern linguistics, Pāṇini's work has been found valuable and the most advanced analysis of linguistics until the twentieth century.
There is a lot of lore that Western linguists like to brush under the rug, especially when India was under British rule. You should actually look into both the languages of the Indian subcontinent and also Persian, Dari and Tajik (yes, Iran, Afghanistan and Tajikistan speak essentially the same language).