,If you had the battery in the wrong way then you will have to have the key reprogreammed at the dealer .
But try this first if does not work you will have to go to the dealer .
Enter the Porsche by the driver's seat and be sure everything is closed. This includes all doors, boot lids and bonnet.
Insert the key into the ignition and turn it clockwise until you start the Porsche engine.
Turn the 911 engine off and remove the key from ignition. Wait 90 seconds before continuing to the next step.
Turn the ignition to the "On" position and wait 15 seconds. This position is as far as you can turn the key without starting the engine. The immobilization light located in the 911 dashboard clock will go out.
Turn the ignition off again then turn it back on. After 15 seconds, the immobilization light will begin to blink.
Enter the four digit security code using the ignition. For instance, if the first digit in the code is three you would turn the ignition from on to off, then back on. This would equal 1 digit, so you would repeat this step two more times if the first digit is "3." Afterwards, wait for the immobilization light to flash then repeat this step for the next digit. After the fourth and last digit is entered, the light will flash again to signal you are in programming mode.
Press a button on the key fob and hold it until the LED light blinks. This will indicate it has been programmed.
Just in case you actually had the button pressed in to many times then it may be out of sync .
Try this you never know:
If you still need further assistance then please don't rate just yet , just get back to me with the reply button, and I will get back to you or inform another expert to assist you if needed
Kindest regards Greg