Best guy friend rejected my hug?

We're really close and have known each other for 9 months now and we talk or text constantly almost every day since we met, occasionally til 3 or even 5 in the morning. I'm honestly not sure if he likes me, but he always makes a specific effort and goes out of his way to see me at break, lunch, in between one of his classes, and sometimes after school. He tried to hug me once a while ago but I was so surprised I might not have reacted as warmly as I usually would, and that was that. Since then, he's only touched my hair and shoulders a few times but we don't touch much. Today, he was in a bad/depressed mood because of something that happened to him yesterday and I asked if he was okay and he said no, so I just hugged him from the side (with both arms) and he after a couple seconds he quietly said "I don't need a hug. Get off me" So I just said "okay" and let go but it was awkward for me. He acted normal after and still came to see me, but I don't know... I'm pretty sure he only acted like that because he was upset.. what do you think? Should I be mad or let it slide or what?
Best guy friend rejected my hug?
Post Opinion