repair: new command to repair repository state