Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git how to revert to specific revision

I have a git project. I just made a commit, then I deleted some directories. ops, my bad. Now I want to restore those directories that I have deleted. how do I do that?

like image 409
bluefoot Avatar asked Dec 05 '25 07:12

bluefoot


1 Answers

One way is to use git reset:

git reset --hard HEAD

This command will discard any working copy changes you have made since the last commit.

like image 146
Greg Hewgill Avatar answered Dec 09 '25 19:12

Greg Hewgill