Helo and Welcome to justanswer...
What you should have done when this happened was leave the radio switched on - with power to it ( may need to leave ign on at least in acc pos ) ... and leaving the radio powered for however long it takes -- sometimes half an hour sometimes several - but then the radio releases and will be ready to accept a code again.. You could still try this but as you have now disconnected the battery - the radio will definaltkly need a code input.
Once the radio becomes receptive for the code again - input the code - and ot should work. The only reason it wont work is , if you are not locking the code in at the end of input - or you are using an incorrect code.
I Sincerely XXXXX XXXXX have helped you - Please ask me if you need more help...
Kind Rgds,.... MIKE
PS...Please press the ACCEPT button if you are happy with my answer/advice given- as thats how I get paid ;)
Feedback is always appreciated too... Thank you .