+7 votes
1 view
in Devops and Agile by (25.5k points)
edited by

I know that Git tracks changes I make to my application, and it holds on to them until I commit the changes, but here's where I'm hung up:

When I want to revert to a previous commit I use:

git reset --hard HEAD

And Git returns:

HEAD is now at 820f417 micro

How do I then revert the files on my hard drive back to that previous commit?

My next steps were:

git add .

git commit -m "revert"

But none of the files have changed on my hard drive...

What am I doing right/wrong?

1 Answer

+8 votes
by (42.6k points)
edited by

Sometimes, this error occurs when you don't initialize the git to that folder (which you are currently working on)

so try:

git init 

For more information about installation of git and common git commands please go through the following link:

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...