Aww, come on ...
So you did something a bit rash in the heat of the moment.
It was stupid, but ... well, we all do things we regret from time to time.
The important thing is ... your partner is innocent. If you don't retract you r statement, you will eventually have to give evidence on oath, at his Court hearing.
You have to just do the decent thing ...
Bite the bullet, go to the Police straight away, tell them you were stupid, and you are sorry, and tell them the truth, and take your punishment on the chin.
The Police will probably be so busy they will be glad to get one case off their books, and they'll send you away with a caution.