In more than one occasion, I found myself accidentally doing a git checkout /path/to/file
which erased my local change in the file, the changes were not added/committed.
Any way to undo that?
There is no way to undo that in git
.
However if you have the file open in your editor you can undo the changes there. Some editors like Emacs auto save files, so try looking for files with the same file name and a ~
or #
extensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With