If your car lost battery power completely then your car's computer system may have lost valuable information to regulate engine performance causing it to stall even after you replace the battery.However, the car's system will quickly collect new data and engine performance should return to normal. In some case you may need to have the throttle body, or your idle air control valve cleaned out as carbon deposits can build up inside these parts, pushing them beyond the computer's ability to regulate engine performance.