There are following ways to catch up/revert changes in GIT
Catchup changes from remote
Pull out from remote again and you lost all of your local changes as well as hisory
rm -Rf working_folders git clone remote_git_address
Merge from remote and this keeps all your local changes
git fetch git merge
Catchup changes from local commit
Roll back all files to the latest commit and you lost all of your local changes not submitted
git reset --head HEAD
Roll back specific files to the latest commit and you keep all of other local changes not submitted
git checkout HEAD specific_file_name
Roll back all files to the latest commit and you lost all of your local changes not submitted. Hoever, this will submit a new commit as revert
git revert HEAD
- Git fast forward: It means code commit submmited should be ordered by time. To resolve the “non-fast-forward” error, you can use command 2 or 3.
git -f pushis not recommended since it forces push to remote.