DEV Community


Discussion on: Git and GitHub: How to Revert a Single File.

connor11528 profile image
Connor Leech

You can also leave the commit hash out, to for instance go back to the most recent commit (the HEAD):

git checkout -- path/to/your/file
Enter fullscreen mode Exit fullscreen mode
Forem Open with the Forem app