Han Dynasty Revival

Under the Qin Dynasty (200 BCE-206 BCE, though focusing it under Emperor Qin Shi Huang), Confucianism was heavily suppressed since it stood in direct opposition to the then-state ideology, Legalism (Fǎjiā). Legalism is in many aspects the opposite of Confucianism, Legalism believed that humans were inherently selfish and that 'moral rule' was much more ineffective than brute force.

Context

Li Si, prominent advisor of the Emperor ordered 'Burning of Books and Burying of Scholars' (213-210 BCE) which basically aimed to kill any opposition, primarily Confucianism. Confucian classics were burned (except for the copies in the imperial library so Qin scholars could interpret it only, no Confucian minds would be able to access it and therefore a reformation of the Confucian school under Qin guidance) and the execution of around 500 (mostly) Confucian scholars under the pretext of them spreading 'dangerous' ideas.

Han Dynasty

This, of course, failed and the Qin were replaced by the Han in 206 BCE. Emperor Wu of Han placed Confucianism as the state ideology. He created the Imperial University in 124 BCE which taught the Five Classics of Confucianism. Important scholar Dong Zhongshu merged Confucianism with concepts like the Mandate of Heaven and Yin-Yang and led for Confucianism becoming the foundation for the Imperial Examination System.

Daoism

Early Han rulers were initially into Daoism, advocating for non-interference in governance though Confucian scholars, now no longer oppressed, convinced rulers to flip to Confucianism.

Undoing of the Qin's actions

Han redistributed Confucian texts with gave scholars restored access to Confucian resources. This led to, among other things, the Old Text vs New Text controversy with scholars debating how authentic some revisions of Confucian texts really were. Han bureaucracy was also filled with Confucian-educated officials who pushed for moral leadership, a contrast to how later Eastern Han became corrupt (yet still Confucian).