It's not your fault.
it's the fault of the person who cancelled backups, the person who didn't check that backups are being created, the "senior" people who let you work on the production database.... etc.
Catalog your rabbit holes if possible, and then review them before working on them.
What I mean is, if you see a problem to solve, and you are able to keep working on your current task and to solve the problem later, then do so... just note the problem. This will immediately make you much more focused.
Then at the end of the day, review your list of rabbit holes and try and determine which ones are necessary for the current project, which ones would be educational / you want to do, and which ones can be discarded.
Basically rabbit holes are a problem because they are long and narrow and do not offer an overview of the entire grounds, so before jumping down a rabbit hole force yourself to survey the big picture and to see if you can step over it instead.
I feel like you describe pretty often. I think the trick is to sleep, exercise, and concentrate on what's going on right now. You can't change the past, you can only change what you are doing right now, this second. You have control over that... hang in there. Also, rosser, you're answer seems very helpful.