The history of Christmas tree is blurry and has many versions. Something quite similar to Christmas tree can actually be traced back to the medieval period. During medieval times, religion was taught through theatre and a play based on Adam and Eve contained a prop that was a decorated fir tree (it was covered with apples were symbolic of the Garden of Eden).
Supposedly, the green of the tree represented immortality while the apples were representative of the fall of Adam. Following the play, many Europeans were fascinated by the trees and decided to set up their own versions. In addition to the apples they added wafers and cookies. These trees really had nothing to do with Christmas but they were definitely an insinuation of things to come.