How to reset a single file from the feature branch to the remote main branch?

Tuesday, October 10, 2023

If we want to revert the file to its state in the master/main branch then we can use the following git command

git checkout origin/master path-to-file

Example

git checkout origin/master ./kubernetes/production/values.yml

Unsure about your interview prep? Practice Mock Interviews with us!

Book Your Slot Now