Use checkout -f instead of restore to discard local changes with tracked files

This commit is contained in:
leo 2020-07-08 09:35:25 +08:00
parent 270b07684c
commit 95030c334f

View file

@ -658,7 +658,7 @@ namespace SourceGit.Git {
if (change.WorkTree == Change.Status.Untracked || change.WorkTree == Change.Status.Added) { if (change.WorkTree == Change.Status.Untracked || change.WorkTree == Change.Status.Added) {
RunCommand($"clean -qfd -- \"{change.Path}\"", null); RunCommand($"clean -qfd -- \"{change.Path}\"", null);
} else { } else {
RunCommand($"restore -- \"{change.Path}\"", null); RunCommand($"checkout -f -- \"{change.Path}\"", null);
} }
} }
} }