There is a branch

ABCDE 

What happens if I go to the checkout B command, to an earlier commit, make changes to the files and make a commit

 git add -A git commit -m "Message" 
  • 2
    You probably already tried. What happened? - 0xdb
  • Only commit AB remains, but can this be done? - Ruslan

1 answer 1

The git β€œbranch” is just a (floating) pointer to a commit.

after the checkout Ρ…ΡΡˆ-ΠΊΠΎΠΌΠΌΠΈΡ‚Π° command of the checkout Ρ…ΡΡˆ-ΠΊΠΎΠΌΠΌΠΈΡ‚Π° this pointer will continue to point to the commit e .

and you can go back at any time with the checkout имя-Π²Π΅Ρ‚ΠΊΠΈ command.


and the commit you created, if you didn’t mark it with any of the pointers - a tag ( tag ) or a branch - will disappear after the next garbage collection.