Restored early repository snapshot

Last night I made some last changes to my code and try to commit them when I noticed I got a warning merge attempt. So i continue the process and later on I noticed I have corrupted the last snapshot of the revision of the code. Im reading a documentation article ( on how to used git revert <SHA> to revert back to an early commit. How I execute the command ? I see the used the command line to invoke the action statement. Do I need to install GitHub in the machine. Any help appreciate, I need to restore this new version for a presentation this afternoon.

I’m not sure what you mean by “corrupted the last snapshot of the revision of the code”. In Git there is the “working tree”, the “index”, and “HEAD”. The “working tree” are the files you edit with your editor. The “index” is what you have marked or “staged” for the next commit. And the “HEAD” is the pointer into the history of all previous commits in the repository. If you corrupted the contents of the working tree, you can always restore the working tree and index to the last commit by using git reset --hard HEAD. _ Warning: this is a destructive action, it will delete any work you’ve done since the last commit._

If I’m not understanding you, please give more details :+1: