You can’t modify the local modifications. Because git protects from losing important changes for that we have 3 options:
Option 1: Commit the changes using
git commit -m” custom message”
Option 2: Stash it
Stash can act like a sack. Where you can push changes and pop them in reverse order use the following commands.
git stash
And do a merge and pull the stash
git stash pop
Option 3: Discard the local changes
using
git reset --hard
or
git checkout -t -f remote/branch
Or:
Discard local changes for a specific file
using
git checkout filename
Also, these git commands will surely help you if you are regularly working with git.