Either way, at the time it was quite worrying - even disturbing - especially when there was work to be done, so think I can relate
Generally I was able to reverse it by working on something which really stimulated me - even hacking away on some goofy personal project after hours - and that kind of bootstrapped me back into a place where I could easily attain flow for "harder" tasks. Can't recommend that highly enough, that and realising that I had different stimulus needs to previously - changing up my coding music, or even foregoing it and switching to mynoise.net yielded some excellent results, or reducing distractions (try periodically disabling system notifications)
That said, if you're really concerned probably see a doc just to rule out any funny business
Ps. Best of luck with it, crossing fingers for you