Note: Beware of what happens if you perform the following commands
- Files that are tracked by Git such as uploaded user contents will not be affected.
- All local changes will be lost.
- Non-pushed local commits will be lost.
git fetch --all// To backup current branchgit branch backup-mastergit reset --hard origin/master // or git reset --hard origin/<branch_name>
git reset --keep as follows:
git fetchgit reset --keep origin/$(git rev-parse --abbrev-ref HEAD)
git reset --hard as follows:
git fetchgit reset --hard origin/$(git rev-parse --abbrev-ref HEAD) # To remove all not committed changes!git clean -fd # To remove all untracked (non-git) files and folders!git pull
Warning: if you don't have your data/files committed yet, note that the commands above can result in loss of them all! Backup your whole repository folder before taking the actions.