A homeless man who kicked a fellow drinker in the head after he reacted badly to him rifling through his bag has walked free from court.