I am pretty sure that the only code that will remain when disconnecting the battery is the original code that came with he car when new. The code that you have set, if any, will disappear and need to be reset. This is not a problem if you have access to the original code.
Search Lincoln Town Car Questions
Are you a UK consumer? CarGurus now has a discussion forum in the UK.
Lincoln Town Car Experts