Its origin dates back to the Spring and Autumn Period. Jin prince Chong'er ran away from the country with his supporters due to persecution. They were homeless for 19 years and things got so bad that Chong'er began to starve to death. One of the prince's faithful followers, Jie Zitui, cut a piece of muscle from his own leg and served it to his master. Chong'er was saved and, in 636 BC, he took back the throne.
He rewarded the officials who had stayed loyal to him but he forgot about Jie Zitui. By the time Chong'er remembered him, a heartbroken Jie Zitui had traveled deep into the mountains. Chong'er wanted to persuade Jie to come home, so he had the hills set on fire. But Jie was later found beside a large tree, with his old mother on his back. Both were dead.
Saddened by the tragedy, Chong'er ordered that fires could not be lit on the day of Jie Zitui's death. From this comes Hanshi Day, or Cold Food Day. People visited Jie Zitui's tomb the next day to pay their respects. Over time, Hanshi Day was replaced with tomb-sweeping day.