“Restablecer Hard Git” Código de respuesta

RESET RAMA EN GIT LOCAL

git fetch origin
git reset --hard origin/master
Wild Weevil

GIT reiniciar duro

$ git reset --hard HEAD       (going back to HEAD)

$ git reset --hard HEAD^      (going back to the commit before HEAD)
$ git reset --hard HEAD~1     (equivalent to "^")

$ git reset --hard HEAD~2     (going back two commits before HEAD)
Devpph

Restablecimiento de git

git reset --soft HEAD~3
git commit
git push —force-with-lease origin
Grieving Gemsbok

GIT reiniciar duro

git reset --hard f414f31
git reset --soft HEAD@{1}
git commit -m "Reverting to the state of the project at f414f31"
Disturbed Duck

deshacer el reinicio de reinicio

$ git init
Initialized empty Git repository in .git/

$ echo "testing reset" > file1
$ git add file1
$ git commit -m 'added file1'
Created initial commit 1a75c1d: added file1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file1

$ echo "added new file" > file2
$ git add file2
$ git commit -m 'added file2'
Created commit f6e5064: added file2
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file2

$ git reset --hard HEAD^
HEAD is now at 1a75c1d... added file1

$ cat file2
cat: file2: No such file or directory

$ git reflog
1a75c1d... HEAD@{0}: reset --hard HEAD^: updating HEAD
f6e5064... HEAD@{1}: commit: added file2

$ git reset --hard f6e5064
HEAD is now at f6e5064... added file2

$ cat file2
added new file
M Hemel Hasan

Restablecer Hard Git

git reset notreCommitCible --hard
Arrogant Antelope

Respuestas similares a “Restablecer Hard Git”

Preguntas similares a “Restablecer Hard Git”

Más respuestas relacionadas con “Restablecer Hard Git” en Shell/Bash

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código