Tag: "git"

The following topics are under this tag:
  1. Como instalar o git?
  2. Como desfazer o último commit (sem ter dado push)?
  3. Como desfazer o último commit no remote branch?

1. Como instalar o git?

Ubuntu/Debian:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git

Arch Linux:

pacman -S git

Windows:

Não sei nem por que você estaria instalando git no Windows, mas ok.
https://git-scm.com/

Gere uma SSH key.

[top] [index]

2. Como desfazer o último commit (sem ter dado push)?

git reset HEAD~
[top] [index]

3. Como desfazer o último commit no remote branch?

Não desfaça! Você pode quebrar os repos das outras pessoas. Mas se mesmo assim você é teimoso (ou é um repo que só você usa), então:

git log # Ache o hash do commit que você quer desfazer.
git push remote_branch_name +hash_que_voce_achou_com_log^:local_branch_name
git reset HEAD^ --hard
git push remote_branch_name -f
[top] [index]