“Git löschen letztes Commit” Code-Antworten

Git löschen letztes Commit

$ git reset --soft HEAD~1
Inexpensive Ibex

Git löschen letztes Commit

$ git reset --hard HEAD~1
Yellowed Yacare

Git löschen letztes Commit

git reset --hard HEAD^
OctoPussLicker

Git löschen letztes Commit

---- [Temporarily switch to a different commit] ----
# If you want to temporarily go back to a particular commit, fool around, 
# then come back to where you are
> git checkout 0d1d7fc32

# Or if you want to make commits while you're there, 
# go ahead and make a new branch while you're at it:
> git checkout -b old-state 0d1d7fc32 

---- [Hard delete unpublished commits] ----
# If, on the other hand, you want to really get rid of everything you've done
# since then, there are two possibilities.
# One, if you haven't published any of these commits, simply reset:

# This will destroy any local modifications.
# Don't do it if you have uncommitted work you want to keep.
> git reset --hard 0d1d7fc32

# Alternatively, if there's work to keep:
> git stash
> git reset --hard 0d1d7fc32
> git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts, if you've modified things which were
# changed since the commit you reset to.
Darkstar

Git löschen letztes Commit

git reset --hard <sha1-commit-id>
Anxious Addax

Git löschen letztes Commit

git push origin HEAD --force
Carlos Arturo Molina Narvaez

Ähnliche Antworten wie “Git löschen letztes Commit”

Fragen ähnlich wie “Git löschen letztes Commit”

Weitere verwandte Antworten zu “Git löschen letztes Commit” auf Shell/Bash

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen