diff --git a/src/ViewModels/FileHistories.cs b/src/ViewModels/FileHistories.cs
index 68c5a7a1..5afd4302 100644
--- a/src/ViewModels/FileHistories.cs
+++ b/src/ViewModels/FileHistories.cs
@@ -79,6 +79,11 @@ namespace SourceGit.ViewModels
_repo.NavigateToCommit(commit.SHA);
}
+ public void ResetToSelectedRevision()
+ {
+ new Commands.Checkout(_repo.FullPath).FileWithRevision(_file, $"{_selectedCommit.SHA}");
+ }
+
private void RefreshViewContent()
{
if (_selectedCommit == null)
diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml
index 6c26fbd3..a00737fb 100644
--- a/src/Views/FileHistories.axaml
+++ b/src/Views/FileHistories.axaml
@@ -111,7 +111,7 @@
HorizontalAlignment="Center" VerticalAlignment="Center"
IsVisible="{Binding IsLoading}"/>
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/FileHistories.axaml.cs b/src/Views/FileHistories.axaml.cs
index dad2baa9..6a2ee7c9 100644
--- a/src/Views/FileHistories.axaml.cs
+++ b/src/Views/FileHistories.axaml.cs
@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Input;
+using Avalonia.Interactivity;
namespace SourceGit.Views
{
@@ -38,5 +39,22 @@ namespace SourceGit.Views
e.Handled = true;
}
+
+ private void OnResetToSelectedRevision(object _, RoutedEventArgs e)
+ {
+ if (DataContext is ViewModels.FileHistories vm)
+ {
+ vm.ResetToSelectedRevision();
+ NotifyDonePanel.IsVisible = true;
+ }
+
+ e.Handled = true;
+ }
+
+ private void OnCloseNotifyPanel(object _, PointerPressedEventArgs e)
+ {
+ NotifyDonePanel.IsVisible = false;
+ e.Handled = true;
+ }
}
}