Git help Plz (important)

My scenario

I have 3 commit in my project (example a, b, c: c is the last commit)
My problem is the now I’m in “c” commit or version how I go to commit “b” then I go to commit
“b” the change should be reflected on Code editor, Then I can switch to commit “c” previous and the last commit change should reflect on the editor,>>> this is my problem plz help me… :slight_smile:

If I understand your issue correct @ajilraju , you only want to go back to a previous commit without changing anything at that point, afterwards jumping back to the commit you came from. If that is the case a git checkout ‘commit hash’ command with the hash being the commit hash you want to go to would do the trick.

If you want a nice overview of the possibilities there’s a nice post on this at StackOverflow.

Hope this helps!

This is working fine…!
Secondly, now I’m the previous commit everything now look old, then I want to go the commit I come from that is the last commit I don’t the hash git log doesn’t show to hash

1 Like

You should be able to see what you’re looking for by using the ‘git log - -all’ command.

Based on what you’re actually aiming for, e.g. just some simple experimenting on what git is and does, or actual work. There are a few alternatives that are more suitable of course.

1 Like

I got the answer,
eventually, use:
git reflog
git checkout master

2 Likes