My battery is being fishy, most likely because I tend to leave my car for a couple of weeks at a time without starting it and the battery gets drained completely. Yes, my fault.

Driving around I noticed trims were all over the place and I saw crazy knock anywhere after 2600ish rpm - pain in the behind. So of course I was like WTF ARGHH. Then on day 2 I remembered my previous incident, walked outside, took the cable off for a few seconds, put it back. Now the car drives fine, learned the trims, minimal knock.
Weird - yes, but like I said this is not the first time so I'm almost positive that there is a way to screw up cpu's learnings by half-resetting the battery.
Thoughts?