Forcing things back on a particular track is not a good idea. Now, admittedly, you have to consider who you are writing for, the nature of the deviation, and the expectations of your client or audience before making a final decision. However, if the nature of the unexpected change of course is not catestrophic to your topic or your thesis, then forcing may be the wrong way to go.
Abandoning the project is not a helpful option ... unless you discover your research is dead wrong, your thesis is in error, or your storyline has holes in it big enough to fly a starship through. Then going for ice cream might be appropriate. Learning from that bitter exercise will come ... in time.
So, go with it. See where that unexpected change takes you. You are likely to make the happy discovery that your work is better for it. Bits and pieces have been coming together as you worked. Connections you didn't realize where there get made and the work improves. This is why you cannot work out any writing in your head alone. You can't map it all out before you sit down and start the work. Allow the happy discoveries and changes in course develop and see where you go. Good luck.