ABSTRACT The interstellar medium (ISM) is an inseparable part of the Milky Way ecosystem whose evolutionary history remains a challenging question. We trace the evolution of the molecular ISM using a sample of young stellar objects (YSO) association–molecular cloud complex (YSO–MC complex). We derive their three-dimensional (3D) velocities by combining the Gaia astrometric measurements of the YSO associations and the CO observations of the associated molecular clouds. Based on the 3D velocities, we simulate the motions of the YSO–MC complexes in the Galactic potential and forecast the ISM evolution by tracing the motions of the individual complexes, and reveal the roles of shear and stellar feedback in determining ISM evolution: Galactic shear stretches Galactic-scale molecular cloud complexes, such as the G120 Complex, into Galactic-scale filaments, and it also contributes to the destruction of the filaments; while stellar feedback creates interconnected superbubbles whose expansion injects peculiar velocities into the ISM. The Galactic-scale molecular gas clumps are often precursors of the filaments and the Galactic-scale filaments are transient structures under a constant stretch by shear. This evolutionary sequence sets a foundation to interpret other gas structures.