If you disconnect your battery and then all of a sudden your engine is running really rough - so rough that it might stall - there’s a really easy fix. By disconnecting the battery the computer forgot its fuel trim information. If you put the car in drive and rev the engine just a bit so it doesn’t stall, maybe around 2000 RPM for about 5 minutes, the computer will relearn it’s fuel trim and start to idle properly again.
![](https://i.ytimg.com/vi/Ulp72690tmQ/mqdefault.jpg)