mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-06-16 21:01:45 -03:00
Update reflog shortname with an ancestry reference (#345)
This commit is contained in:
@ -414,8 +414,7 @@ $ git push --force-with-lease [remote] [branch]
|
||||
If you haven't pushed, to reset Git to the state it was in before you made your last commit (while keeping your staged changes):
|
||||
|
||||
```
|
||||
(my-branch*)$ git reset --soft HEAD@{1}
|
||||
|
||||
(my-branch)$ git reset --soft HEAD^
|
||||
```
|
||||
|
||||
This only works if you haven't pushed. If you have pushed, the only truly safe thing to do is `git revert SHAofBadCommit`. That will create a new commit that undoes all the previous commit's changes. Or, if the branch you pushed to is rebase-safe (ie. other devs aren't expected to pull from it), you can just use `git push --force-with-lease`. For more, see [the above section](#deleteremove-last-pushed-commit).
|
||||
|
Reference in New Issue
Block a user