You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cheat sheet: Suggest git-restore for discarding changes (#2079)
In modern versions of Git, `git status` will suggest using `git restore`
in these cases. Also, in all other instances, the cheat sheet already
lists `git switch` or `git restore` alternatives to `git checkout`.
## Changes
<!-- List the changes this PR makes. -->
- Add `git restore <file>` and `git restore --staged --worktree <file>`
as alternatives to `git checkout <file>` and `git checkout HEAD <file>`,
respectively.
## Context
Make the cheat sheet more consistent with `git status`. Also, when
teaching Git to new users, using `git switch` and `git restore`
consistently in place of `git checkout` arguably makes common workflows
easier to understand; and being able to point those new users to the
official cheat sheet without introducing new commands would be a big
bonus.
0 commit comments