Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to Overwrite Local Files with Git Pull.

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.