Restore Mac from Time Machine Backup via Terminal I ran into some major problem today when trying to delete old TM backups from an external drive.

Now that I have a Time Capsule I wanted to clear the old backups from another external drive. At some point, Yosemite suddenly stopped working properly, Keychain errors popped up, my Desktop was empty, user folders cleared, etc. It looked like I accidentally deleted my own User folder. I checked the Terminal from where I attempted to delete old TM Backups and it really looked like I did nothing wrong. I thought, well, I must have overlooked something but for that reason I have Backups in the first place, so I booted into recovery and selected restore from Backup to facilitate my new Time Capsule. Since all Backups are password protected I tried to enter my password but got the error message that the system could not connect. I rebooted into what was left of my user and checked that the Time Machine password was in fact correct.

Anyway, now I got access to the TC via tmutil and was wondering how I can restore the whole machine via Terminal.
You likely do not want to attempt this from Terminal but if you did you would want to use tmutil restore ... Read the manual page - for what that involves. The issue will be you will have to specify via the command line where in the time capsule snapshot the restoration will be sourced from.

For more likely success you probably should re-boot using the Recovery HD or some other graphical user interface mechanism intended for this kind of restore from disaster scenario that will guide you in finding the right snapshot as described in the Time Machine FAQ