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,180 points
1,264 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 18, 2020 by MD
• 95,140 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,180 points
120 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,140 points
178 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 in Git & GitHub by MD
• 95,140 points
178 views
0 votes
1 answer

How to create branch in GitHub from my local Git repo?

Hi@akhtar, To sync your existing branch in GitHub, ...READ MORE

answered May 7, 2020 in Git & GitHub by MD
• 95,140 points
134 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,032 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,140 points
107 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,140 points
170 views