How to rollback "Discard all changes"? #2987
Unanswered
antosha417
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Unfortunately there is no way to get that file back via git because git only has undo functionality relating to commits. It would be awesome if lazygit had a general undo feature that included changes to files but it would be a very complex feature. As for preventing accidental discards, when you press d, a pop-up should appear confirming that you want to discard the file's changes. I consider that a pretty good protection. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
More times that I care to admit I accidentally deleted newly created files with lazygit.
What do I do:
<c-d>
and then I hit<space>
to stage those file.d
in place of<c-d>
and then hitspace
. This discards changes to the entire file and I don't have any idea how to revert it. Since git does not yet track this file, it seems to be gone forever.Do you have any ideas how I can rollback this accidental deletions? Or even better avoid them in the first place
Beta Was this translation helpful? Give feedback.
All reactions