I have pushed a commit which modified a git subtree (not by pulling from the repository where the subtree was initially pulled). What is a clean way to restore the subtree to be what it used to be?
Following ways to do it
git revert ddlpopp
(replace ddlpopp with your commit id). This will simply add a new commit reverting the changes in the specified commit. This can be used for any commit not just the last commit. It may introduce some unexpected changes, so be careful and review before pushingExplicit rewrite of the head. This should be used extremely rarely. This will simply reset the head of the remote
git reset --hard HEAD~1
git push -f
Here is an excellent article http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html