Git reset - not working as expected

I am trying to check repository history. I stopped at the point where I want to return the repository back to a specific commit. I searched and I did

git reset --hard 12345

I received a message saying that HEAD is now in 12345. I opened the folder to see the file that I wanted to see, but it has not changed!

I wanted to go back to 2009 when this file was first created. However, the file was in a new version (after editing in 2010).

I checked the working directory, but there is nothing there. I also ran

git clean -f -d

but nothing has changed.

I don’t know what to do now. I want to go back in time to see what the files look like, but I want to go back to the whole repository.

+4
source share
3 answers

, , ,

git reset --hard 12345

, git reset --hard ". , , , . , , 12345. git reset --hard

"temp_branch", 12345.

git checkout -b temp_branch 12345

"temp_branch", HEAD 12345. , , .

+4

, , , reset. reset , . , git checkout 12345. , , , git checkout master ( ).

, , , ? git diff 12345 branch_name -- filename.

+1

stage , git reset --hard

git add. => ( .)

git reset --hard =>

0

All Articles