Reputation: 187
I've done the process described at this link http://toroid.org/ams/git-website-howto
It works like a charm, but now I have to revert, temporarily, the remote repository (and the checkout) to a previous state.
I think that I probably just need to revert locally and push (and the checkout will work properly) but I'm not sure.
Notice that it is not a definitive revert, just a temporary one (think of it as if I pushed the latest changes to production before I should)
Upvotes: 5
Views: 4781
Reputation:
In your local repository use git reset --mixed <commit>
then git push --force
to the remote. You may need to stash the uncommitted changes first.
From the git-reset manpage:
--mixed
Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated. This is the default action.
Upvotes: 8
Reputation: 133138
Reset your local master (assuming it's the master branch you want to revert of course) branch to your previous commit and push it to the server with -f or --force
git reset --hard HEAD^
git push -f origin master
Upvotes: 3