Skip to content

Instantly share code, notes, and snippets.

@marlondenisck
Last active November 15, 2021 17:59
Show Gist options
  • Select an option

  • Save marlondenisck/f67968357ce19b0590ed97cc18c21bbe to your computer and use it in GitHub Desktop.

Select an option

Save marlondenisck/f67968357ce19b0590ed97cc18c21bbe to your computer and use it in GitHub Desktop.
Git Emergencia.md

Escreveu mensagem de commit errada?

  • Isso aqui vai alterar a mensagem do último commit:
git commit --amend -m "nova mensagem de commit"

  • Quer adicionar algum arquivo novo ou nova alteração no último commit sem alterar a mensagem?
git add .
git commit --amend --no-edit

  • Quer desfazer o último commit, mas não quer perder as alterações?
git reset HEAD~1 --soft
  • Agora, se quiser jogar fora o último commit e também as alterações dele, basta trocar o "soft" por "hard":
git reset HEAD~1 --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment