How to Revert Git Commit Remote

First, There are serveral revert situation: Local:

1
2
3
# this will detach your HEAD, i.e. leave you with no branch checked out.
git checkout 0d1d7fc32
git checkout -b old-state 0d1d7fc32
1
2
3
4
5
6
7
8
9
10
# Don't do it if you have uncommitted work you want to keep
git reset --hard 0d1d7fc32

# Alternatively, if there's work to keep:
git stash
git reset --hard 0d1d7fc32
git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts, if you've modified things which were
# changed since the commit you reset to
1
2
git add . && git checkout master -f
git add . && git reset --hard HEAD

Remote

1
2
3
git push mathnet +dd61ab32^:master
git reset HEAD^ --hard
git push mathnet -f

.

Comments

Comments