Skip to content

Basic git question #22794

Sep 2, 2020 · 13 comments · 2 replies
Discussion options

You must be logged in to vote

git checkout FILE will overwrite the working tree file with the current HEAD version, so for example:

git checkout base/models.py

You can give multiple files at once. Alternatively you could use git reset --hard HEAD to reset all files in the working tree to the HEAD state. I prefer the checkout approach because it does less damage in case of a mistake. 😉

Replies: 13 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Lokita233
Comment options

Comment options

You must be logged in to vote
1 reply
@Lokita233
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants