diff --git a/notes/2023-09-26.md b/notes/2023-09-26.md index 1ee4062..850d2f3 100644 --- a/notes/2023-09-26.md +++ b/notes/2023-09-26.md @@ -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. -``` \ No newline at end of file +``` +### 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. +