Unless you're 4'5" and slightly framed, there is no possible way eating more than 1,000 calories daily can lead to (permanent) weight gain. So what we have here is temporary weight gain.
If a person is under-eating (and you ARE), then when they first start to eat more appropriately their body does exactly what it's trained to - it stores that as extra fat. Your body has most likely shut down metabolism and is cannibalising its own muscle to survive on so low an intake, and in that mode, it stores fat incredibly easily. So when you gain initially when eating "right", you freak out and go back to the nice safe low eating that doesn't make the scale budge the wrong way - right?
What you need to do is toss your scales. Work out a generally accepted healthy intake level for yourself (you'll need to do that as you haven't provided us any information to do it for you). Then eat at that level for AT LEAST eight weeks and toss your scales away. Absolutely no weighing in those 8 weeks at all. Then you can start weighing again.
Just don't freak out if it's still higher. It should be on the downward path week by by week by that time.
Deb, in New Zealand