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, 2020 in Git & GitHub by akhtar
• 38,170 points
150 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, 2020 by MD
• 95,060 points

Related Questions In Git & GitHub

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,890 points
813 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
• 10,530 points
6,843 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
1,453 views
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,170 points
109 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
956 views
+2 votes
1 answer
0 votes
1 answer

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

Hi@akhtar, You can use reset command to do ...READ MORE

answered Jul 18, 2020 in Git & GitHub by MD
• 95,060 points
935 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,060 points
132 views