Last active
September 9, 2019 11:13
-
-
Save supervoron1/93592740244132b1027678b15c50dff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------AMEND CASE | |
git log --oneline | |
d142679 second commit | |
86f1495 first commit | |
git add main.c --- внесли изменения в файл и решили закомитить ВМЕСТО second commit(последнего) | |
> git commit --amend -m "third commit" | |
> git log --oneline | |
18411fd third commit | |
86f1495 first commit | |
В резульатате из репозитория пропал коммит с id=d142679, вместо него теперь коммит с id=18411fd. | |
---------REVERT CASE | |
$ git log --oneline | |
891019e (HEAD -> develop, origin/develop) develop branch update | |
818ba60 develop branch added | |
950de04 (origin/master, master) second commit | |
9dd512b one commit | |
$ git revert 891019e (далее в редакторе соглашаемся, сохраняемся и выходим) | |
[develop 1785b9c] Revert "develop branch update" | |
1 file changed, 1 deletion(-) | |
$ git log --oneline | |
1785b9c (HEAD -> develop) Revert "develop branch update" - последний коммит отменем и код в файле изменился | |
891019e (origin/develop) develop branch update | |
818ba60 develop branch added | |
950de04 (origin/master, master) second commit | |
9dd512b one commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment