In normal git flow in case you have to
In case you want to
It will
You can also use:
It will reset your working directory and replace all changes (including the index).
#git #checkout #reset #hard
checkout
a file you would use:git checkout -- your_file_name
In case you want to
checkout
multiple files you give other file names in front of checkout --
. Sometimes there are bunch of modified files that you want to checkout all of them at once, so you need to go to the root
of the project and:git checkout -- .
It will
checkout
all files in your project.You can also use:
git reset --hard
It will reset your working directory and replace all changes (including the index).
#git #checkout #reset #hard
I usually use linux copy command
files added into the project.
To revert all the C**P and make a clean slate of your project again, you just need to do 2 things:
1- git checkout .
2- git clean -f
First command will revert all modified files into their previous state. Second one will remove all untracked files.
Happy copying :)
#git #revert #checkout #clean #git_clean
cp
to copy files from my project into a production environment project. I copied wrong files by accident from a different repo into production environment and messed up the repo. Some files got into modified state, many untrackedfiles added into the project.
To revert all the C**P and make a clean slate of your project again, you just need to do 2 things:
1- git checkout .
2- git clean -f
First command will revert all modified files into their previous state. Second one will remove all untracked files.
Happy copying :)
#git #revert #checkout #clean #git_clean