Git hard reset cleaning resetting and reverting everything
The following will remove all builds artefacts, work in progress, getting you back to a clean state.
Replace the part in bold by your branch.
git fetch origin git reset --hard origin/master git clean -f -d
If you have submodules
git clean -xfd git submodule foreach --recursive git clean -xfd git reset --hard origin/master git submodule foreach --recursive git reset --hard
Alternate way :
Remove all directories but the .git folder, then do :
$> cd my-repo
$> rm -fr * # from the git root directory this will not remove the .git folder
$> git checkout -- *
Recent Comments