Activity Forums Salesforce® Discussions How to roll back Git Commit in salesforce?

  • Kumar

    Member
    February 4, 2017 at 7:14 am

    Hi Vikas,

    Reverting Working Copy to Most Recent Commit
    To revert to a previous commit, ignoring any changes:

    git reset --hard HEAD

    where HEAD is the last commit in your current branch

    Reverting The Working Copy to an Older Commit
    To revert to a commit that's older than the most recent commit:

    # Resets index to former commit; replace '56e05fced' with your commit code
    git reset 56e05fced

    # Moves pointer back to previous HEAD
    git reset --soft HEAD@{1}

    git commit -m "Revert to 56e05fced"

    # Updates working copy to reflect the new commit
    git reset --hard

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos