Whether or not you have a legal basis to do anything from a legal perspective against your former employer giving you a bad reference depends upon what the reference actually states.If the reference is written up as a form of an "opinion" then you do not. If the reference has untruths in it perhaps you may particularly if the untruths are defamatory. Typically a former employee really has no legal basis to contest a poor reference by his or her former employer. However, you should consult with an employment attorney and go over with reference that you are writing about.