While there's no knowing for sure. I've always interpreted it as Worf is swapping out with other Worfs, who in turn end up in his prime quantum reality while he is in theirs, & then they most likely revert back to their original one once he exits theirs. The only other way to look at it is that he is permanently displacing every Worf he replaces in some other unknown way, & instead of reverting back to their original reality when he exits theirs, they are passed off to some other alien one, in some other type of pattern or even randomly. I prefer the former notion. It just makes more sense in my head, but either is possible I guess
Honestly, the ONLY thing I don't like about this episode is that nothing was ever mentioned about how this situation affected prime Worf's comrades. Since we see a Worf on their ship during this, it's fair to assume at least one, & possibly multiple Worfs visited that ship during this, one of whom would have been quite distraught to find out that not only wasn't he the 1st officer, but that his kids didn't exist & his wife had never even thought of him romantically.
I feel like it was a rather unfortunate & somewhat cheap cheat to reset the clock at the end so that none of them retain those memories. Frankly, I was never really sold on the Troi/Worf relationship. While it made a certain amount of sense for his character, it really seemed off for hers. There's really nothing from which to glean the possibility of her finding him a worthwhile match. HOWEVER, if she'd been visited by a Worf, who in his reality was her husband & father of her children, she might have seen him in an entirely different light, and it could be exactly the type of thing that could make her open herself up to that possibility. As it stands, we just have to assume that because "our" Worf saw HER in that light, that he somehow began changing how he behaved toward her, & that, in itself, stirred her feelings for him, which is a little less impressive a story imho.