I used to do this as a result of a) depression and b) OCD disorder and I used to check things like locking the doors several times. It became noticeable when during 6th form, someone said to turn around because I had a bold patch on my head. From that day I wore my hair up and have done till a week ago when Ive worn my hair down when Ive gone shopping. Believe me, this was something I was nervous about as I haven't worn my hair down in mid day since I was 16 and am now 21. I don't have many suggestions as ppl have said others in this thread, but putting my hair up did stop me doing it as much as I used to, and as getting older and more confident in myself, I realised I didn't want loads of scraggy ends in my hair and I told myself to stop doing it. After time, if you find your hand going to your head, say no and find an activity to do .i.e. homework, exercise, reading etc..