How can I undo these 3 commits?

Asked

Viewed 304 times

0

inserir a descrição da imagem aqui

$ git status Refresh index: 100% (16/16), done. On branch master Your branch is Ahead of 'origin/master' by 3 commits. (use "git push" to Publish your local commits)

Changes not staged for commit: (use "git add ..." to update what will be Committed) (use "git checkout -- ..." to discard changes in Working directory)

    modified:   Blender/web/Aquario-concreto.html
    modified:   Blender/web/Aquario.html
    modified:   Blender/web/Banheiros.html
    modified:   Blender/web/Jaula-arame.html
    modified:   Blender/web/Jaula-oncas.html
    modified:   Blender/web/Jaula-porta-metal-grade.html
    modified:   Blender/web/Portaria.html
    modified:   Blender/web/Refeitorio.html
    modified:   "Blender/web/Zool\303\263gico.html"
    modified:   Blender/web/casa-lembrancas.html
    modified:   Blender/web/jaula-flamingos.html
    modified:   Blender/web/jaula-leao.html
    modified:   Blender/web/jaula-passaro-guara.html

Untracked files: (use "git add ..." to include in what will be Committed)

    Blender/web/Lago-cisnes.html
    Blender/web/jaula-aves-lado-aramado.html
    Blender/web/jaula-aves.html
    Blender/web/jaula-babuino.html
    Blender/web/jaula-camelo.html
    Blender/web/jaula-cangurus.html
    Blender/web/jaula-grupo passaros.html
    Blender/web/jaula-pinguins.html
    Blender/web/jaula-repteis.html
    Blender/web/jaula-suricates.html

no changes Added to commit (use "git add" and/or "git commit -a")

1 answer

2


Before giving the command I recommend that you backup the folder with your project. The entire folder including . git files/

git reset --hard HEAD~3

Or, to be more exact, you can go back to a particular commit: Give a:

git log

Now just take the commit id that you want to go back to and give the following command, replacing the ID with your commit id

git reset --hard ID

  • Okay, thank you so much for your help. I’m having to go up TCC scores in separate commits to not exceed the maximum size allowed by GIT (50MB per commit).

  • if it worked, mark the answer as accepted or useful. Thank you. Anything I am available.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.