How can I revert a single file to a previous version? [duplicate]

Is there a way to go through different commits on a file.
Say I modified a file 5 times and I want to go back to change 2, after I already committed and pushed to a repository.

In my understanding the only way is to keep many branches, have I got that right?
If I’m right I’m gonna have hundreds of branches in a few days, so I’m probably not understanding it really.

Could anyone clear that up please?

5 s
5

Leave a Comment