In fact, the Confucianism that rose during the Tang and Song dynasties was NOT a rejection of Buddhism and the return to the "old ways." It incorporated a number of Buddhist and Daoist ideas into Confucian teaching, the result of which was known as neo-Confucianism. Orthodox Confucianism had emphasized morality and practical political issues. Neo-Confucianism, which was heavily influenced by Buddhism, emphasized social harmony and proper personal behavior. The best known authority of neo-Confucianism was Zhu Xi, who wrote Family Rituals. In this work, he wrote on the proper etiquette for funerals, weddings, and even veneration of ancestors. Whereas orthodox Confucianism had dealt mainly with practical affairs, Zhu Xi wrote extensively on metaphysical matters, something totally alien to earlier Confucianists. Among his other concerns was the issue of the nature of reality, which he said could be two forms: li, the essence of all being; and qi, the material form of reality.
So the rise of Confucianism was actually a blend of Confucian, Daoist and Buddhist ideas; not a return to the old ways of practical Confucianism. Neo-Confucianism reflects substantial Buddhist and Daoist influence, although the Confucians did not accept either as a religion.
During the Tang dynasty there was a rise in interest in the ideas of Confucianism. People started to become more interested in Confucian ideas instead of the Buddhism that had become popular. Scholars generally argue that there were two reasons for this revival.
First, the Chinese became more inward-oriented as they started to lose power to the "barbarians." They started to feel as if they should give more respect to their own native ideas at a time when they were starting to lose out to foreigners in political and military matters.
Second, the Chinese felt that the old ways had worked better. They noticed that previous dynasties had been more successful and they thought that maybe going back to the old ways would help them to regain that kind of success.
For these reasons, they started to become much more interested in recovering Confucian ideas and returning them to a prominent place in society.