Git reset II


#1

i do this and not work
first

$git log

and

$git reset 7
$git log

and dont work why?


#2

what you need to do is
git reset commit_(first seven characters of your desired commit)


#3

Hi @abdullahghanem, @shashank97 is almost there. In order to reset HEAD to a previous commit in your commit log, you need the command:

git reset

Followed by the first 7 characters of one of the commit SHAs from your log. So for example, if you want to reset to a previous commit which has the SHA 3c75f7807e21c6ae0a1516a6c023282a4a4a835d you can use 3c75f78. The final command to reset to this previous commit would be:

git reset 3c75f78

Hope this helps. Happy learning!

Dan


#4

this method doesnt work


#5

Not work. What we should doing now?


#6

this method doesnt work


#7

It seemed to work that I used SHA of the second from the last commit.

$ git log                                                                                                                                                   
commit 82f927dcb691bb18527e87cbe329e67f1d79b4fe                                                                                                             
Author: codecademy <ccuser@codecademy.com>                                                                                                                  
Date:   Thu Nov 5 13:25:23 2015 -0500                                                                                                                       
                                                                                                                                                            
    Implement Larry Laertes name swap                                                                                                                       
                                                                                                                                                            
commit d640dc3b22b3ee1d0a6e87477a35fd5e75c0712e                                                                                                             
Author: codecademy <ccuser@codecademy.com>                                                                                                                  
Date:   Thu Nov 5 13:19:17 2015 -0500                                                                                                                       
                                                                                                                                                            
    Complete ghost line of dialogue                                                                                                                         
                                                                                                                                                            
commit 7be7ec672af73cf31ef72c92e3374fd4e29c675a                                                                                                             
Author: danasselin <johndoe@example.com>                                                                                                                    
Date:   Tue Nov 3 17:15:05 2015 -0500                                                                                                                       
                                                                                                                                                            
    Add first page of scene-7.txt                                                                                                                           
                                                                                                                                                            
commit 83f7b3591f4ab7aedb3160388b59e65ee1cd94a2                                                                                                             
Author: danasselin <johndoe@example.com>                                                                                                                    
Date:   Tue Nov 3 17:14:48 2015 -0500                                                                                                                       
                                                                                                                                                            
    Add first page to scene-5.txt                                                                                                                           
                                                                                                                                                            
commit 5d692065cf51a2f50ea8e7b19b5a7ae512f633ba                                                                                                             
Author: danasselin <johndoe@example.com>                                                                                                                    
Date:   Tue Nov 3 17:14:30 2015 -0500                                                                                                                       
                                                                                                                                                            
    Add first page to scene-3.txt                                                                                                                           
                                                                                                                                                            
commit 27a3bfe282808aefe69d04f4d111e7a6a0c652dd                                                                                                             
Author: danasselin <johndoe@example.com>                                                                                                                    
Date:   Tue Nov 3 17:14:08 2015 -0500                                                                                                                       
                                                                                                                                                            
    Add first page to scene-2.txt                                                                                                                           
                                                                                                                                                            
commit 96f1625d347d599e6f0f13f23022b3f852d5b116                                                                                                             
Author: danasselin <johndoe@example.com>                                                                                                                    
Date:   Tue Nov 3 17:13:38 2015 -0500                                                                                                                       
                                                                                                                                                            
    Add .gitignore                                                                                                                                          
$ git reset d640dc3                                                                                                                                         
Unstaged changes after reset:                                                                                                                               
M       scene-2.txt                                                                                                                                         
M       scene-3.txt                                                                                                                                         
M       scene-7.txt                                                                                                                                         
$

#8

you can try this : git log git reset SHA(Followed by the first 7 characters of one of the commit SHAs from your log. So for example, if you want to reset to a previous commit which has the SHA 3c75f7807e21c6ae0a1516a6c023282a4a4a835d you can use 3c75f78)


#9

git log doesn't work for me, and I doubt it is working for many of the other people on here. It returns "fatal: Unable to read current working directory: No such file or directory". I am thinking it is a bug, since I still pass the first step.
Anyways, the command can start working again for no reason at all if you restart the entire web browser a couple of times.


#10

I also think that it is a bug...
For me the "get help"->restart this exercise worked.


#11

Nope... you have to do it, just like this.


#12

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.