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

Reorder the git restore examples #120

Open
ehogan opened this issue Jan 29, 2025 · 1 comment
Open

Reorder the git restore examples #120

ehogan opened this issue Jan 29, 2025 · 1 comment

Comments

@ehogan
Copy link
Member

ehogan commented Jan 29, 2025

Helper feedback from the Introduction to Git and GitHub training on Wednesday, January 29, 2025:

Reorder the git restore examples in the Reverting Changes section; the examples should be in the order:

  • git restore
  • git restore --staged
  • git restore -s <sha> then git commit
  • git revert

Someone mentioned in the chat that git restore --staged is the opposite of git add, so it might be worth having a little diagram showcasing adding changes to the point of committing the changes, then how to get out of each step. Something like https://git-scm.com/about/staging-area, but with the reverse 😊

@astroDimitrios
Copy link
Member

astroDimitrios commented Jan 31, 2025

@ehogan Can you add a bit more detail here why there is a git commit?

git restore -s then git commit

Should we do:

Undoing Changes

  • git restore
  • git restore --staged
  • git revert

Recovering previous file versions

  • git restore -s then git commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants