function exit(error) {
    var errorCode = 0;
    if (error) {
        console.error(error);
        errorCode = 1;
    }
    console.log('\n\nRestoring files...');
    runProcess('git', ['checkout'].concat(SOURCES)).then(
        function() {
            process.exit(errorCode);
        },
        function() {
            process.exit(1);
        },
        function() {}
    );
}
Exit handler. Restores file changes before exit.

@param {Error} error