Which sequence lets you switch while keeping your edits for later?
$ git switch other error: Your local changes to the following files would be overwritten by checkout: config.ini Please commit your changes or stash them before you switch branches.
git restore config.ini, then switchgit branch -f other HEADgit switch --detach othergit stash, thengit switch other
Stashing saves the edits and cleans the working tree so the switch can proceed;
Play Git ▸
git stash pop brings them back. Restoring the file would throw the edits away.