# git ## discard local changes ```bash #all unstaged files in current working directory git restore . #specific file git restore PATH/FILENAME ``` ## change origin url ```bash git remote set-url origin ``` ## Create new branch from uncommited ```bash git switch -c # or git checkout -b ``` ## Credentials ```bash git config --global credential.helper cache # Cache for 1 hour git config --global credential.helper "cache --timeout=3600" # Cache for 1 day git config --global credential.helper "cache --timeout=86400" # Cache for 1 week git config --global credential.helper "cache --timeout=604800" ```