Member-only story

git: revert specific file

--

Assuming the file you want to revert to a previous commit has the relative path: src/App.jsx` and the commit you want to revert it to has the has abcde`,

run git checkout abcde -- src/App.jsx src/App.jsx

That’s it.

--

--

Nazreen Mohamad
Nazreen Mohamad

Written by Nazreen Mohamad

Technical Instructor and Software Engineer.

No responses yet