Git (TortoiseGit) - How to revert a single file to a previous revision and then undo the revert?

后端 未结 5 1651
感动是毒
感动是毒 2020-12-14 15:29

When using Git with TortoiseGit: Does somebody know how to revert a single file(or a complete repository) to a previous revision?

For example I have a repository con

5条回答
  •  借酒劲吻你
    2020-12-14 15:52

    It is also possible to get a specific file:

    • Right-click on the file
    • Choose the menu item: Git Show Log

    TortoiseGit show a dialog with a list of all revisions

    • Click on the prior revision (2)

    In a list in the bottom of the dialog it shows all the files associated with the commit

    • Find the file you are looking to view
    • Right-click on that file and Save Revision To
    • This will save that previous revision of the file with the commit number concatenated on the file

    For example: - original file is file.txt - revision 2 will save as file-67b51a8.txt

    I'm using TortoiseGit v2.2.0.0

提交回复
热议问题