How to rollback file to much earlier version using Git

Start with:

$ git log

which shows you a list of recent commits, and their SHA1 hashes.

Next, type:

$ git reset
You may need to use the --hard option if you have local modifications.

git checkout may work better than git reset.

git checkout
git checkout -b

You can then rebase that against your mainline when you are ready to merge those changes:

git checkout
git rebase master
git checkout master
git merge

You can do it from IDE instead of command line too.


Popular posts from this blog