DIAGNOSIS This is the number one post-storage problem: old gas. Gasoline starts to break down and form varnish in as little as 30 days, especially the ethanol-blended fuel. This gunk clogs the tiny jets and passages in the carburetor, causing a lean, uneven run.
FIX Don't keep trying to run it on the bad fuel. First, drain the tank completely. Then, remove the carburetor bowl drain screw (usually a small bolt on the bottom of the carb) and let any old fuel in the carb drain out. Refill the tank with fresh, high-octane, ethanol-free gasoline if possible. Add a dose of a fuel system cleaner like Seafoam to the new gas (follow the can's directions). Start it up and let it run under a moderate load (like a space heater) for at least 30 minutes. The cleaner and fresh fuel can often dissolve minor gumming.
IF THAT DIDN'T WORK If surging continues, the carburetor likely needs a deeper clean or rebuild. The pilot jet is probably clogged. This involves removing the carb, disassembling it, and cleaning all the passages with carb cleaner and compressed air. Kits with new gaskets and jets are available.
HEADS UP For future storage, always use a fuel stabilizer in the tank and run the generator for 5-10 minutes to get the treated fuel into the carburetor before you store it. Even better, for long-term storage, drain the tank AND the carburetor bowl dry.