Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oleglomako/405fc8fa2bec086634741efc553f43c0 to your computer and use it in GitHub Desktop.
Save oleglomako/405fc8fa2bec086634741efc553f43c0 to your computer and use it in GitHub Desktop.
Отменить последний коммит, но сохранить изменения:
git reset HEAD~
Удалить последний коммит и откатить изменения:
git reset --hard HEAD~
Команда git reset откатывает HEAD до определенного состояния.
В нашем случае она откатывает HEAD до HEAD~ (сокращенно от HEAD~1),
что означает состояние на один коммит старше чем HEAD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment