If you feel the need to discard all your local changes and just reset/overwrite everything with a copy from the remote branch, then you should follow this guide.
Important: If you have any local changes, they will be lost. With or without –hard option, any local commits that haven’t been pushed will be lost.
If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected.
The Overwrite workflow:
To overwrite your local files do:
git fetch --all
git reset --hard <remote>/<branch_name>
For example:
git fetch --all
git reset --hard origin/master
This will give message like below
HEAD is now at f2**a6* adding last_commit_name
Thanks for reading.
Keep Coding.
- What is On-Page Optimization and Off-page Optimization - March 14, 2024
- [SOLVED] Flutter : PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - December 7, 2021
- [Solved] Flutter : Error: The getter ‘subhead’ isn’t defined for the class ‘TextTheme’ from package:flutter/src/material/text_theme.dart’ – searchable_dropdown - December 6, 2021