Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git discard all changes command

git reset –hard		# Revert uncommitted changes in index
git clean -fxd		# Remove newly created files that not in index
Comment

discard all changes

git clean -df
git checkout -- .
Comment

git discard all local changes

git restore .
Comment

git remove all changes

For all tracked unstaged files use:

git checkout -- .
The . at the end is important.
Comment

git undo all changes

use "git restore <file>..." to discard changes in working directory
use "git restore --staged <file>..." to unstage
Comment

PREVIOUS NEXT
Code Example
Shell :: powershell delete files older than 15 days 
Shell :: docker exec logs 
Shell :: check if variable contains string bash 
Shell :: ssh to a docker container 
Shell :: install readline-sync 
Shell :: Install Google Cloud SDK Snap 
Shell :: electron build windows exe 
Shell :: npm ganache 
Shell :: pacman update 
Shell :: linux remove nested files with names 
Shell :: how to convert openssl to keytool 
Shell :: create react app with npm not yarn 
Shell :: youtube to mp4 linux 
Shell :: install kubectx 
Shell :: check ram on linux 
Shell :: conda install mmcv 
Shell :: show git tree in terminal 
Shell :: -bash: jupyter: command not found linux 
Shell :: Error: ENOSPC: System limit for number of file watchers reached, 
Shell :: for loop in shell script 
Shell :: linux get host ip local 
Shell :: delete local git repository command line creates by react 
Shell :: taskkill 
Shell :: Kali linux Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? virtualbox 
Shell :: alpine linux free port 
Shell :: epub to pdf converter ubuntu 
Shell :: remove large file from git history 
Shell :: bash command check 2 arguments 
Shell :: install bin on ubuntu 
Shell :: vs code permission ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =