Skip to content

Instantly share code, notes, and snippets.

@robsonfaxas
Last active October 12, 2018 04:00
Show Gist options
  • Save robsonfaxas/ea6a6211e5cea655eefd7c2a87f0dcdc to your computer and use it in GitHub Desktop.
Save robsonfaxas/ea6a6211e5cea655eefd7c2a87f0dcdc to your computer and use it in GitHub Desktop.
#git - 4 - Trabalhando com commits
-- Ver mudanças que um commit fez, a partir de uma tag
git show g5h736774fhbb88fdb3vd829eb
-- Ver modificações feitas nos arquivos atuais, antes de commitar
git diff
-- Ver apenas os nomes dos arquivos alterados, antes de commitar
git diff --name-only
-- commitar todos os arquivos modificados (All Modified)
git commit -am "Arquivo ReadMe.txt alterado"
-- Enviar todos os arquivos para staged
git add .
-- voltar atrás uma alteração, antes de ir para staged
git checkout Readme.txt
-- voltar atrás arquivos enviados para staged
git reset HEAD Readme.txt
-- voltar atrás um commit, com os arquivos em staged
git reset --soft g5h736774fhbb88fdb3vd829eb
-- voltar atrás um commit, com os arquivos modified
git reset --mixed g5h736774fhbb88fdb3vd829eb
-- voltar atrás um commit, desprezando todas as alterações
git reset --hard g5h736774fhbb88fdb3vd829eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment