Skip to content

Instantly share code, notes, and snippets.

@DavidAntliff
Created March 21, 2017 22:28
Show Gist options
  • Save DavidAntliff/6543f463fb371c49a379e203410f07d9 to your computer and use it in GitHub Desktop.
Save DavidAntliff/6543f463fb371c49a379e203410f07d9 to your computer and use it in GitHub Desktop.
Git Rinse - revert a project back to a just-cloned state quickly
#!/bin/bash
# Note: this removes all uncommitted changes and untracked files!
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment