I definitely have in the past. What’s helped is taking regular breaks (once every 60 - 90 minutes) and structuring my work around the breaks. For me, sitting (or even standing) for more than 60 minutes starts to cause discomfort and misalignment in my posture (if you want to go deep on this topic, I recommend this book
https://www.amazon.com/New-Rules-Posture-Stand-Modern/dp/1594771243/ref=sr_1_3?keywords=new+posture&qid=1554459586&s=gateway&sr=8-3).
I’ve also found walking around for a few minutes, getting water, and getting out of the headspace of the problem quite restorative. Sometimes, I also get some creative ideas (presumably b/c I’m able to use my full brain when walking vs when I’m sitting)!
This is all anecdotal FWIW!