Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added question to 9 26 notes #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion notes/2023-09-26.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ References until the full notes are added:

Use an issue to submit a question for today, or make a PR to post a question and the best answer you can find (I'll review and fix if needed before posting) for a community badge.

```
```
### Can use reset to go forward in time commit-wise. For example, if you reset too far back, can you go back to a more recent commit?

Yes if you notice right away, the objects are still there and you can get them back. If you run many porcelain commands after the erroneous `reset` git may run [garbage collection](https://git-scm.com/docs/git-gc) to optimize performance and remove any unreachable objects. It traces the commit history, logs which objects are in there, and reachable there, including branches, and then deletes remaining objects that are not reachable in any ways.

This would only apply, however, if you were reseting all relevant branches, not if you reset one branch but leave the commits on another, because in the latter case, they commits would still be reachable.