A
A
Anton Mikhailov2021-07-23 10:15:04
git
Anton Mikhailov, 2021-07-23 10:15:04

Git - can't figure it out?

Hello colleagues!
I'm trying to work with Git. Installed locally (VS Code). Git Hub is not needed yet.
Created a .html file
In the file I wrote in the title - the number 1
created commit
In the file I made changes to the title - 2
created a new commit
git log shows 2 commits

For example, I want to rollback to 1 commit and see the number 1 in the title, see these changes in the file html.
What should be done? How to see again in header - 1?
There are commands to rollback to previous commits, but they do not change the content of my title in the file in any way!

PS Perhaps I did not understand the essence of Git (what it can do), or it is only for viewing changes, but it does not return the previous version of the working html file (content).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya, 2021-07-23
@fAntonM

git hist
to get the hash of a specific commit
git checkout <hash>
to get back to a specific commit by its hash

D
Dmitry Shitskov, 2021-07-23
@Zarom

Here are two useful links to get familiar with git

  1. https://githowto.com
  2. https://learngitbranching.js.org/?locale=ru_RU

A
Anton Mikhailov, 2021-07-23
@fAntonM

Thanks)
git checkout - works)
And by the name, tell me how to call the desired commit - for example, I have -a -m"2"
git commit -a -m"2"
Dmitry, thanks for the second link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question