How to roll back to previous version in Git?

0 votes
Hi Guys,

I have three versions of my file in Git. I want to go my first version due to some reason. How can I do that?
Apr 29 in Git & GitHub by akhtar
• 14,770 points
40 views

1 answer to this question.

0 votes

Hi@akhtar,

You can roll back your previous version any time. Follow the below given steps.

$ git reset version_id file_name
$ git checkout -- file_name

Hope this will help.

answered Apr 29 by MD
• 33,220 points

Related Questions In Git & GitHub

0 votes
0 answers

How can I retrieve previous version data in Git & GitHub!!?

Hi, I accidentally commit in a wrong version. ...READ MORE

Feb 3 in Git & GitHub by akhtar
• 14,770 points
165 views
0 votes
1 answer

How to do a re-merge into another branch in git

Seems like you want to rebase your ...READ MORE

answered May 7, 2018 in Git & GitHub by DareDev
• 6,850 points
477 views
0 votes
1 answer

How to give a file execute mode permissions in Git?

You can easily do this in one ...READ MORE

answered Aug 6, 2018 in Git & GitHub by Sophie may
• 9,940 points
3,384 views
0 votes
1 answer

How to add a remote git repository in Jenkins

Follow these steps: Step 1 Go to Manage ...READ MORE

answered May 23, 2019 in Git & GitHub by Alok
216 views
+13 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,420 points
542 views
0 votes
1 answer
0 votes
1 answer

How to configure git send-email in local system?

Hi@akhtar, To use git send-email service you have ...READ MORE

answered May 4 in Git & GitHub by MD
• 33,220 points
46 views
0 votes
1 answer

How to untrack a file in Git?

Hi@akhtar, You can untrack your file from git ...READ MORE

answered May 4 in Git & GitHub by MD
• 33,220 points
66 views