How to revert a Git repository to a previous commit

0 votes

Hi Guys,

I have multiple commits to a Git repository. Now I want to revert back to a previous commit to see the older data. How can I do that?

Dec 21, 2020 in Git & GitHub by akhtar
• 38,180 points
74 views

1 answer to this question.

0 votes

Hi@akhtar,

This depends a lot on what you mean by "revert". If you want to temporarily go back to it, then you can use the git reset command as shown below.

$ git checkout ID
answered Dec 21, 2020 by MD
• 95,240 points

Related Questions In Git & GitHub

0 votes
2 answers

How to view the nested workflow of a local git repository?

The closest way to view branches in ...READ MORE

answered Aug 2, 2019 in Git & GitHub by Sirajul
• 59,090 points
440 views
0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,670 points
893 views
0 votes
1 answer

How to forcefully commit a file to Git even if the file is ruled as unchanged?

This is simple, just follow the below ...READ MORE

answered Jul 11, 2018 in Git & GitHub by Sophie may
• 10,550 points
2,640 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
2,443 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,196 views
+2 votes
1 answer
0 votes
1 answer

How to add an empty directory to a Git repository?

Hi@akhtar, A popular solution is to simply add ...READ MORE

answered Oct 5, 2020 in Git & GitHub by MD
• 95,240 points
122 views
0 votes
1 answer

How to change the URL for a remote Git repository?

Hi@akhtar, You can use the git remote command ...READ MORE

answered Nov 21, 2020 in Git & GitHub by MD
• 95,240 points
112 views