Skip to content

How do you discard changes in one file? #2154

Answered by mark2185
metov asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to discard just a specific file, move the cursor to the file.

d discard whatever is under the cursor, it's as if you wrote git checkout -- <thing under cursor>. If it's a directory, it'll discard that directory. If it's a file, it'll discard that file.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sebkolind
Comment options

@metov
Comment options

@mark2185
Comment options

mark2185 Apr 6, 2023
Collaborator

Answer selected by metov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants