I've been working in my own branch which has several commits over the past few weeks. The latest changes have been pushed to GitHub (nothing to commit, working tree clean). On GitHub, I found my Brewfile.lock.json was modified at the very beginning and all dependencies in it had been updated to their latest versions (unintended). I must have updated this on accident and would like to remove any changes on the Brewfile.lock.json so they are as they were in the beginning on master.
I've looked up ways to do this, but I'm not understanding clearly. How can I basically remove any modifications I made to this file on my branch (not delete it entirely from the repository)?
It is located in my first commit, and it is one of many files that were committed. I've tried:
git co (commit) Brewfile.lock.json
-> "Updated 0 paths from (commit)"
git revert Brewfile.lock.json
-> "fatal: bad revision 'Brewfile.lock.json'"
git reset Brewfile.lock.json
-> No change
git rm Brewfile.lock.json
-> "rm 'Brewfile.lock.json'" (removed completely, which is what I do not want)
Thank you for the help. I'm new and I've spent a lot of time browsing StackOverflow and reading tutorials trying to figure this out.