Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseGit - Revert?

I am using TortoiseGit. I want to revert back to a point earlier before i had deleted a few images.

How do i do this, the methods of reverting that i have seen are incorrect....

like image 322
Goober Avatar asked Aug 26 '09 15:08

Goober


People also ask

Is TortoiseGit free for commercial use?

It is developed under the GPL. Which means it is completely free for anyone to use, including in a commercial environment, without any restriction.

How do I uninstall TortoiseGit?

Use TortoiseGit → Delete to remove files or folders from Git. When you TortoiseGit → Delete a file, it is removed from your working tree immediately as well as being marked for deletion in the repository on next commit.

How do I commit in TortoiseGit?

Select any file and/or folders you want to commit, then TortoiseGit → Commit.... The commit dialog will show you every changed file, including added, deleted and unversioned files. If you don't want a changed file to be committed, just uncheck that file.


2 Answers

Right click your working directory and select Show Log from the TortoiseGit menu.

After that you can right click previous commits and reset the branch to that commit.

like image 123
Ryan Kearney Avatar answered Oct 02 '22 22:10

Ryan Kearney


If you deleted a few files and you have not made a commit yet, Revert will work just fine. Selecting TortoiseGit -> Revert... will display a window for you to select the files you want restored. Deleted files will show in red.

If you already committed the delete, then you can Reset to a commit before you deleted the files. Be warned that if you use reset, you will no longer see in your log the commit(s) after the commit you reset to.

If you want to preserve in your log the commit that deleted the files, you can Checkout the commit before the delete into a new branch, copy the restored files into a separate folder, switch back to your original branch, then add the files back to your original branch.

like image 35
James Lawruk Avatar answered Oct 02 '22 23:10

James Lawruk