You know that you ate poorly, and if it was high sodium, you will have some water weight gain. This may take several days to go away. I'm guessing you are on Lasix, so that may help remove the water weight, but if you were losing weight, and some bad food caused water weight gain, just resume eating the healthy diet your doctor has you eating, and in a few days, the weight loss will resume.
You may be able to tell when the water weight is gone, by the swelling in your feet disappearing, so that you can see veins, or just being able to breathe easier. However, if you were already losing weight before, then you will go back to losing weight, and will eventually lose all that you gained, and set a new low.
What you need to be concerned with most with CHF is weight gain for no explicable reason. This is a sign of you not removing the water from your heart and lungs properly, for a variety of reasons, none of them good. This is why they tell you to call your doctor if you gain 5 lbs in a week, with no reason why. If you ate poorly, you have a reason why, and if you stop doing it ( harder than it sounds, I know ), the side effect of water weight gain, will also stop.
I wouldn't panic. With CHF, huge water weight gains are possible, and as long as you start dropping weight ( most often accompanied by frequent bathroom visits ), you are on the way to getting back on track.