Once you have established a habit it will be with you forever. You might be able to learn "out" of it, but it will still be there. Perhaps it's replaced with a stronger habit, or it can be so that the cue isn't there anymore.
This is the shadow of those bad habits you have gotten rid of: it's so easy to slip back to them. If something happens to the replacement habit it's like nothing happened at all.
The positive thing is that the same is true with the good habits: they are all also there, waiting to be reignited. You don't have to spend weeks to get back on track with those either. Just start doing them again!
For a long time I wrote first thing in the morning. It grew into a rather strong habit. But then my daily rhythm changed and I couldn't keep up with it anymore. Now, thanks to this situation, my days are again stable enough I can return to that habit. And once I started, it has been like I never stopped doing it in the first place.