I put the battery in backwards and I think that caused the car to forget the key
Unfortunately you may have more damage than that, connecting a battery backwards can quickly burn out computer modules, it just takes a split second. You might want to consult the pertinent service manual for troubleshooting information.