git reset --hard # removes staged and working directory changes
## !! be very careful with these !!## you may end up deleting what you don't want to## read comments and manual.git clean -f -d # remove untrackedgit clean -f -x -d # CAUTION: as above but removes ignored files like config.git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)
git add -p # Add changes in chunks.git commit -m"DISCARD: Some temporary changes for debugging"git add -p # Add more stuff.git commit -m"Docblock improvements"git tag archive/local-changes-2015-08-01git rebase -i (commit id) # rebase on the commit id before the changes.# Remove the commits that say "DISCARD".