Git Cheatsheet Reverting a file git checkout main -- /path/to/file git checkout other-branch -- /path/to/file git checkout a1b2c3 -- /path/to/file