Revert to a previous state of a file

646 views
Skip to first unread message

mi...@marinescu.dk

unread,
Feb 19, 2014, 9:58:10 AM2/19/14
to tortoise...@googlegroups.com
Hi,
I need to do a revert on a file where i revert a file to a previous version (not caring what happened to the file in the meantime, neither do i want to discard the history that happened).

With command line thing i can do :

git checkout XXXX -- filename.txt
git commit -m"reverted file"

How can i do same thing with TortoiseGIT ?


ch3c...@gmail.com

unread,
Feb 19, 2014, 7:14:13 PM2/19/14
to tortoise...@googlegroups.com, mi...@marinescu.dk
1. Open Show Log
2. Select the revision XXXX
3. Select filename.txt from the file list
4. Right click, choose "Revert to this revision"
5. Open Commit Dialog
6. Enter commit message "reverted file"
7. Make sure the file filename.txt is checked.

mi...@marinescu.dk於 2014年2月19日星期三UTC+8下午10時58分10秒寫道:

Mihai Marinescu

unread,
Feb 21, 2014, 6:45:32 AM2/21/14
to ch3c...@gmail.com, tortoise...@googlegroups.com
Thanks, that works but what is the difference between this and "Revert change made by this commit" ?

ch3c...@gmail.com

unread,
Feb 21, 2014, 8:06:04 AM2/21/14
to tortoise...@googlegroups.com, ch3c...@gmail.com, mi...@marinescu.dk
"Revert to this revision" calls git checkout <revision> -- <file>
This restores a single file from the revision specified.

"Revert change made by this commit" calls git revert <revison>
This creates a rollback commit. Changes are reversed from all the changed files in <revision> .

Mihai Marinescu於 2014年2月21日星期五UTC+8下午7時45分32秒寫道:
Reply all
Reply to author
Forward
0 new messages