How can I retrieve previous version data in Git GitHub

0 votes
Hi,

I accidentally commit in a wrong version. How can I go to the previous version?

Can anyone tell me the concept?

Thank You
Feb 3, 2020 in Git & GitHub by akhtar
• 38,260 points
4,851 views
I think git revert can help in this. Please look for it.

Thanks. I will try this. But we can also use git reset

For example,

$ git reset "version id" filename.

$ git checkout filename.

1 answer to this question.

0 votes

Hi@akhtar,

You can use reset command to do this task.

$ git reset "version id" filename.
$ git checkout filename.

I hope this will help.

answered Jul 19, 2020 by MD
• 95,460 points

Related Questions In Git & GitHub

0 votes
0 answers

How to use p4merge tool in Git & GitHub?

Hi, Can someone tell me, how to use ...READ MORE

Jan 31, 2020 in Git & GitHub by akhtar
• 38,260 points
626 views
0 votes
1 answer

How to roll back to previous version in Git?

Hi@akhtar, You can roll back your previous version ...READ MORE

answered Apr 29, 2020 in Git & GitHub by MD
• 95,460 points
1,076 views
0 votes
1 answer

How do I go to a particular version of a file in the Git repository?

Hi@akhtar, You can use git checkout <sha1> to check ...READ MORE

answered Jan 5, 2021 in Git & GitHub by MD
• 95,460 points
2,907 views
0 votes
0 answers

How can I save username and password in Git?

I want to do a push and ...READ MORE

May 24, 2022 in Git & GitHub by Kichu
• 19,040 points
820 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
0 votes
1 answer

How merge works in Git & GitHub!!!??

Hi@Hasid, In Git & GitHub merge concept comes ...READ MORE

answered Jan 31, 2020 in Git & GitHub by MD
• 95,460 points
815 views
0 votes
1 answer

How can I set ssh key in GitHub?

Hi@akhtar, First you have to generate key using ...READ MORE

answered Feb 4, 2020 in Git & GitHub by MD
• 95,460 points
904 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP