I assume you mean you modified the PLC code. Did it compile w/ no errors or warnings (Rebuild All)? Until you get a good build, you won't be able to go online. I have seen cases where we got only partly online - some code windows showed debug view and others not. I think that means your PLC code has problems, since after fixing the code all showed debug view.
"Clean All" deletes the links between PLC variables and I/O memory locations. I always answer "No" to the "Keep Unchanged?" box. After a clean, I recall you need to "Activate Configuration" again in "System" to re-map the I/O. Then, "Rebuild All" again to be safe.
In TwinCAT2, you do above by going back and forth several times between two separate programs - "System Manager" and "PLC-Control". It is a little klunky, but you better understand what is going on. It is more behind the scenes and integrated in TwinCAT3, but also less obvious how it works.
Restarting the PLC loads the last "Boot project" code. BTW, if your PLC code has errors, it might hang as the boot code starts. I have seen that when bad PLC code crashes Windows (array index out of bounds). To fix, start Windows in Safe Mode and delete the boot project in the TwinCAT folder, then reboot.
For safest use in a production environment, after you have robust PLC code and any HMI, to lock it down use the "embedded write filter" of Win7E. Beckhoff's CX come w/ a little Windows utility to set it. That stops writes to the hard drive (SSD). That means no matter what Operator's do, if they reboot the PC it will come up in the last configuration. Avoids 3 am trips to the plant.