error: Your local changes to the following files would be overwritten by checkout

Warning: Running this will discard local changes. Only run this if you want to discard local changes.

I encountered the same problem and solved it by

git checkout -f branch

and its specification is rather clear.

-f, –force

When switching branches, proceed even if the index or the working
tree differs from HEAD. This is used to throw away local changes.

When checking out paths from the index, do not fail upon unmerged
entries; instead, unmerged entries are ignored.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)