The movie makes this seem confusing because of the manner in which the witch disappears, but she actually doesn't die. She simply reenacts the curse (to get her powers back) and then disappears, leaving the others to fend for themselves against the Giant.
From Sondheim.com's "Into the Woods: a plot summary by Bruce Janiga":
The Witch finally interrupts their argument reminding them that they have an impending deadline as the Giant still wants Jack. The others protect Jack from her and will not let her feed him to the Giant. Fed up with them she leaves them alone, disappearing from the stage.
Also, the scene differs between the original production and the revival; the movie mirrors the original:
From Broadwayworld.com
It depends on the version you're talking about.
In the original production, Bernadette disappears through the floor in a puff of smoke after tossing some of the beans in the ground.
In the revival, Vanessa eats some of the beans and her hair begins to fall out and she begins to become the gnarled woman she began the show as, before falling through the floor in smoke.