I know that if the batsman hits his wicket with bat, glove etc he is out but what is the rule in this case?
The striker wouldn't be out: the wickets in question would have been the wickets at the non-striker's end. (Of course, had it been his own wickets that the ball went on to hit, that's out bowled).
If, however, the ball deflects off the bowler's hand on the way though, and the non-striker is out of his crease (if he's backing up, this is almost a given), the non-striker can be given out (run-out). It happened in
this match, for example. Additionally, if the ball deflects off the non-striker's wickets and is then caught by a fielder without the ball bouncing, the striker is out caught.