gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Restore File When Viewing History

Open Joe-Zer0 opened this issue 3 months ago • 2 comments

Is your feature request related to a problem? Please describe. I had a need to restore a file to it's previous version.

Describe the solution you'd like In gitui, I went to the Files tab, found the file I wanted to restore, and viewed the history. From here I can view the the previous versions of the file. It would be useful if I could restore to whatever version I have highlighted.

Describe alternatives you've considered What I did was use my mouse to copy the commit-id from the history view in gitui. Then run the following command git restore <file-name> -s <commit-id>~. Of note is the tilde at the end, this restored to one commit before the given commit-id. That fit my use case best.

Additional context Thanks for your consideration!

Joe-Zer0 avatar Oct 02 '25 16:10 Joe-Zer0

Oh thats would be handy, we should have everything needed for that.

extrawurst avatar Oct 03 '25 00:10 extrawurst

I'm glad you like the idea. Also thank you for making such an amazing tool!

Joe-Zer0 avatar Oct 03 '25 00:10 Joe-Zer0