As far as I've seen with a lot of game dev projects, having to redo a project after a while tends to work out pretty well, so long as it's not some 100-hour game with a bazillion gameplay mechanics that would take a decade to do over again.
I've never been a coder, but as far as I can tell, most coders learn a lot of new things as they work on a project, and often all the old code becomes a total mess that gets hard to work with and breaks things, so loads of devs will actually do remakes of their own games, or rewrites of their old code or whatever, just to clean out all the spaghetti.