checkout: split part of it to new command 'restore'