hardReset function
Reverts all local changes in the directory
Implementation
Future<void> hardReset(Directory directory) async {
final result = await Process.run('git', [
'reset',
'--hard',
'origin/main',
], workingDirectory: directory.path);
_throw('Could not run "git reset --hard origin main"', result);
}