Sorry to hear that, but do not be nervous and just relax. You can use some cold water, and you can either soak your eyes in the water or let the water flush your eyes. And keep doing this for about 10 minutes. If it still burns, use towels with icy water and you can use some eye drops. If it still hurts tomorrow go to see eye doctor.
There has some methods for you to get the tea tree oil out of your eyes. Firstly, please do not rub your eyes after it's happening to avoid the bruise of your corneal. You can close your eyes for several minutes, if the tears will rush it out, you can wink your eye, and the foreign body will rush out of your eyes. If it can not work, please prepare a basin of clean water; put your eyes under the surface of water. Wink your eyes for several seconds, the foreign body will go out. The last way, is use cotton swab or clean handkerchief soaking in the cold boiled water, then sweep it softy out from your eyes. Don't rub your eyes by hands, for the sake of avoiding infection by virus. After all the foreign body's out, adapt some eye drops to prevent your eyes from infection.
Tea tree oil if sometimes used to treat a specific form of blepharitis caused by demodex.The treament focuses on the eyelids but if some gets in the eye, although it might be irritating, it is unlikely to lead to permanent vision loss. Most foreign substances contacting the eyes pose risks of infections, ph injuries (acid/base), or thermal injuries (temperature effects), other than the direct force effects involved.In general, ample irrigation without rubbing is a good start. If there is any question of injury (such as changes in vision, discomfort, increased or persistent redness) you should see an ophthalmologist soon!
Tea tree oil is a kind of magic oil can used both internally and externally. It can be drooped into eyes, however, you'd better be careful. Most tea tree oil is too raw, then the eyes can't absorb. You can buy some eye drops made of tea tree oil.
Don't do that personally, you may be caught into trouble after the oil make your eyes blurred.