Git rollback 1 pull

git reset –hard HEAD^1 will take you back one commit from what you pulled. If you want it back to the state it was in before you pulled, use git reset –hard HEAD@{1}. The @{1} tracks where the head was at before the last operation that changed it in your local repo, so it will … Read more

ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

None of the other answers fix the root cause of the issue. The problem is that when Postgres raises an exception, it poisons future transactions on the same connection. The fix is to rollback the offending transaction: begin ActiveRecord…do something… rescue Exception => e puts “SQL error in #{ __method__ }” ActiveRecord::Base.connection.execute ‘ROLLBACK’ raise e … Read more

Will a using statement rollback a database transaction if an error occurs?

Dispose method for transaction class performs a rollback while Oracle’s class doesn’t. So from transaction’s perspective it’s implementation dependent. The using statement for the connection object on the other hand would either close the connection to the database or return the connection to the pool after resetting it. In either case, the outstanding transactions should … Read more

How to revert (Roll Back) a checkin in TFS 2010

You have two options for rolling back (reverting) a changeset in Team Foundation Server 2010 Version Control. First option is using the User Interface (if you have the latest version of the TFS 2010 Power Tools installed). The other option is using the TFS 2010 version control command-line application: tf.exe rollback I have information about … Read more

Undo changes in entity framework entities

Query ChangeTracker of DbContext for dirty items. Set deleted items state to unchanged and added items to detached. For modified items, use original values and set current values of the entry. Finally set state of modified entry to unchanged: public void RollBack() { var context = DataContextFactory.GetDataContext(); var changedEntries = context.ChangeTracker.Entries() .Where(x => x.State != … Read more