Skip to content

Restore File When Viewing HistoryΒ #2729

@Joe-Zer0

Description

@Joe-Zer0

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions