S.47 requires to things - the act of committing the offence, which you clearly did - hitting him with the bat.
and the intention or recklessness to case ABH - which again, was present with you taking the bat to 'scare him'
however, you did so, as you said in self-defence. Now, if you hit him in the leg, and only the leg, in order for him to leave you alone - plead self defence and you should be aquitted.
Also, the guy who attacked you will be charged with Assault and also S.47 and also Racial abuse - so, he's looking at a prison sentence and you can be looking at an aquittle.
my advice would be consult a solicitor.