1. Quit caffeine on a Thursday and take the day off on Friday (optional).
2. Go for a hike on Friday, Saturday and Sunday. (optional but recommended)
3. Each day you need to force yourself to try and focus on programming as well. You should get something - anything - committed into the repo you're working in. Motivation and your mental state is one thing that you need to train while you're at your nadir. When you get your energy back it'll seem like you were never on caffeine in the first place.
4. On each of those days take a nap any damn time you please. Take pain killers if you must.
Come Monday you should be at about 80%-90%. Enjoy your freedom.
I've used this technique twice after trying to transition unsuccessfully a few times before. Been off it for 7ish months now. Good luck, friend.