Legally, you will have to pay the money back, but you can take your time over it.
If cour concience will let you, draw it out in cash, and wait for them to chase you for it. When they do, offer to replay at �50 per month.
The error was theirs, you withdrew the money in good faith, and you have demonstrated a willingness to repay the debt.
If they get stroppy, tell them you'll ask the Ombudsman to sort it out - they will accept then.
Then put the money in a high-interest ISA and make some interest on it, and set up a Standing Order (not a Direct Debit or they'll snaffle the lot!) on your current account.
I know it works - I have done it. It was my payback to the Co-Op for massively mistreatring me as a customer.