Skip to content

Oh shit I want to roll back a bunch of commits without deleting them #156

@thedjdoorn

Description

@thedjdoorn

Let's be fair: nobody uses revert for fun, and reset is a landmine if used incorrectly. You don't need them anyway, since we have:

git checkout *hash* .

Which resets all files to the status of that commit. Combine with git clean -df to remove any file or directory that wasn't being tracked at the time. Run a new git commit and boom, back to work. Nothing (of value) was lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions