What should have I done , was I right?

My guy friend since 2 years, had a crush on me from past 1 year. He confessed to me. Though I knew he was serious, I rejected him as I did not want to spoil the friendship and was scared of commitment. Now that it is 2 years after the situation it seems he has not overcome, and ignores me as heck and in case if I ask him something he comes up with a savage reply. But when someone teases me he becomes protective, and he also gets intrigued when I use phone as if he fears of me being in some kind of a relationship. What should I do?
What should have I done , was I right?
Post Opinion