DEV Community

Discussion on: Bash Functions & Git - How to wipe out changes made to a specific file

Collapse
 
stephencweiss profile image
Stephen Charles Weiss

Yup! That would work too.

I think the reason I avoided git checkout is that I think of it as branch management, not files.

I concede that it's a totally valid way of doing this -- though, the flag of -- is rather ambiguous to me. :)

Collapse
 
oligospermia profile image
Mesalazine

Technically speaking, it is part of branch management: you are checking out = resetting a file (or files, as you can use * wildcards) to the original branch state.

Thread Thread
 
stephencweiss profile image
Stephen Charles Weiss

Got it. That makes a lot of sense. I'll update cpkg to git checkout -- package*.json.

Sometimes you just need to put things out there to have people show you a better way! Appreciate it!