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 containing multiple files. One file exists in three revisions (1 ; 2 ; 3). Now I want to change from revision 3 back to 2.
TortoiseGit offers a "Revert" function in the "Show log" dialog which allows to jump back to a specific revision, but this will revert your whole repository instead of a single file.
Also once I have reverted something, I don't have a clue how to undo the revert and jump back to the newest revision.
From the command line: git checkout
is probably what you want.
The documentation shows an example of:
$ git checkout master~2 Makefile
to revert Makefile
to two revisions back in the master branch
From within TortoiseGit (via Windows Explorer) it looks like you can do this with the following steps:
Show log
from the TortoiseGit context menuRevert to this revision
1 files revert to e19a77