Commit 93bfdfb
authored
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.1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| 221 | + | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| |||
0 commit comments