revertLocalChanges function

Future<void> revertLocalChanges(
  1. Directory directory
)

Reverts all local changes in the directory

Implementation

Future<void> revertLocalChanges(Directory directory) async {
  final result = await Process.run('git', [
    'restore',
    '.',
  ], workingDirectory: directory.path);

  _throw('Could not restore all changes', result);
}