@𝓒𝓱𝓻𝓲𝓼

If you’ve made a change, there are several options.

If you don’t mind the change – in other words, if it can be discarded – simply discard it with

git restore <file>

If the change is important to you, use stash:

With

git stash

you save your modified file and temporarily remove it from the working directory.

git pull

will then run and fetch the latest version of the file. You can then retrieve your modified version using

git stash pop

However, this will cause the changes made to the newly fetched file to be lost, which may not be what you want.