I suffer from insomnia, and my sleep schedule often gets screwed up like this. After 20 or so years of this, I've found only ONE thing works. Forcing myself not to sleep during the day, no matter how little sleep I got the night(s) before.
You cannot break your sleep schedule by sleeping, only by staying awake. This is how you broke it in the first place, most likely.
You MUST make a pact with yourself, and stick with it. Absolutely no sleeping between 7am and 8PM. (adjust for your work schedule) This allows you to go to bed as early as you want to make up for lost sleep the night(s) before, but it does not allow you to sleep during the time periods that will disrupt your sleep cycle.
And yes, as soon as you correct your sleep schedule, you MUST make up those lost sleep hours. Sleep is like a credit account. If you lose some, you gotta pay it back, or it adversely affects your health.