Q:

How to define a button inside Manipulate that tells Mathematica to re-evaluate the whole Manipulate code?

I have written a Manipulate code carrying out some very complicated tasks. There is no problem for the first run, but if I click the reset button to reset all variables to their initial states (which is also ok) and click the run button a second time, then it is very likely that the Mathematica kernel will crash during the re-run progress, the frequency for such crash happening is about 9 out of 10 times.
I have spent almost a month trying to track down the source of this problem, but failed. I also asked the Wolfram support team, they suggested to implement the Quit function in the reset button as a workaround, such that the reset button will make the kernel quit, since the first run is always ok.
Now the problem is, I cannot directly put Quit[] inside the button, for by doing this the kernel loses all definiton about the enclosing Manipulate. So I need the reset button doing two tasks:

Quit the kernel.
Make Mathematica automatically re-run the enclosing Manipulate code.

I wonder if this is possible?

A:

I suppose that your problem is rather in not efficient/proper Manipulate structure but since it is 900 lines long I think we can't help to fix it.
Here's the solution you've asked, I think so, isn't it?
Manipulate[
  Column[{
          Plot[Sin[x - n], {x, 0, 12.4}],
          Button["reset",
                 SelectionMove[EvaluationNotebook[], Previous, Cell];
                 SelectionMove[EvaluationNotebook[], Previous, Cell];
                 NotebookDelete@Cells[GeneratedCell -> True];
                 ClearAll["Global`*"];
                 SelectionEvaluate[EvaluationNotebook[]];
                ]
        }]
 , {n, .3, 11.8}]

